What are WordPress salts and keys for?
WordPress signs authentication cookies and nonces using a set of secret keys and salts defined in wp-config.php. There are eight in total — four keys (AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY) and their matching _SALT pairs. Each should be a long, random, unpredictable string — never the placeholder text from the default template.
How to add them to your project
- Copy the generated block above and paste it into
wp-config.php, replacing the existingdefine('AUTH_KEY', ...)lines (or the placeholder block if this is a fresh install). - Save the file and reload the site — all active sessions will be logged out.
- Never commit
wp-config.phpwith real salts to a public repository; keep it out of version control or load the values from environment variables instead.
Rotating keys after a compromise
If you suspect a session or cookie was stolen, regenerating all eight values immediately invalidates every existing login across the site — a fast way to force re-authentication everywhere without touching the database.