About this tool
Every WordPress install bakes eight secret strings — AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY and the matching AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT and NONCE_SALT — directly into the cookies that sign in admins, refresh session tokens and verify nonces. The defaults shipped in wp-config-sample.php are identical for every download, which means any attacker who has read the public WordPress source already knows the keys for sites that never rotated them. This generator produces a fresh set, locally in your browser, in the exact eight-define() format that lives below /* That's all, stop editing! Happy publishing. */. Each secret is 64 characters long by default (the same length WordPress's own secret-key service returns) drawn from your browser's CSPRNG via crypto.getRandomValues, and you can dial the length anywhere between 32 and 128 characters with a slider. The result is a complete PHP block with a copy-to-clipboard button and a downloadable wp-config.salts.php file, so you can paste straight into the file or stage it via your deploy pipeline. Generation runs entirely on your machine — the keys are never transmitted, which is the only acceptable behaviour for the secrets that guard an admin login.
How to use wp-config.php Salt Generator
- Pick a secret length on the slider — 64 characters matches the WordPress default and the API at api.wordpress.org/secret-key/1.1/salt/.
- Press Generate new salts. Eight secure strings are minted instantly from your browser's CSPRNG.
- Copy the resulting PHP block or download it as wp-config.salts.php.
- Paste the block into wp-config.php immediately above the /* That's all, stop editing! */ line and save the file.
Frequently asked questions
How long should each secret be?
64 characters is the standard length used by WordPress and the official secret-key API, with more than enough entropy for any practical attack. Going shorter (32 characters) is acceptable for low-traffic installs; longer values (96-128) cost nothing and future-proof against unforeseen weaknesses.
Where do these defines go in wp-config.php?
Paste the entire block directly above the /* That's all, stop editing! Happy publishing. */ comment near the end of the file. WordPress falls back to safe defaults if the defines are missing, so keeping them inside the main wp-config.php guarantees they ship with the codebase rather than living in a database.
When should I rotate the salts?
At least once on first install (the sample values are public), and again any time you suspect a compromise — a leaked backup, a former administrator who kept a copy, or a staging environment that shared a wp-config.php with production. Rotating the salts instantly invalidates every signed cookie, so logged-in users are forced to authenticate again.
Are the generated values sent anywhere?
No. Each secret is built character by character from crypto.getRandomValues on your device. Nothing is uploaded, logged or stored outside the page; close the tab and the only copy of the values is the one you pasted into wp-config.php.