Salt Key Generator
Produce a new set of WordPress authentication keys and salts, in the format your install actually reads.
What this tool does
Salt Key Generator produces the eight constants WordPress uses to sign its cookies and nonces: AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY and NONCE_KEY, with the matching AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT and NONCE_SALT. Every character is drawn from crypto.getRandomValues through rejection sampling, so the spread is even rather than tilted towards the start of the alphabet the way a plain modulo would tilt it.
The default character set is the one api.wordpress.org draws from, and it deliberately leaves out the apostrophe and the backslash so each value sits inside a PHP single-quoted string without escaping. It does still contain $, braces, backticks and a space, which certain .env readers and container tools treat as syntax rather than text — that is what the letters-and-digits-only option is there for. The same eight constants can be emitted as wp-config.php defines, WP-CLI wp config set commands, .env assignments or a JSON object, though the format is picked before the run and every run mints new values — there is no way to re-emit one set in a second format.
Two limits are worth knowing before you paste anything in. This tool writes nothing: it hands you text, and you edit your own file — assembling a complete configuration is what wp-config Generator does instead. And when you paste an existing block, only define() lines are scanned, for constant names ending in KEY or SALT, so extras are carried over and regenerated from a PHP block but not from a .env or JSON one. It never reads your current values or checks whether they are still the placeholder phrase; everything it names comes back with a fresh value regardless.
Replacing these constants ends every logged-in session on the site, including your own, because the cookies were signed with the old keys and no longer verify. Nonces stop matching as well, so a form somebody left open fails until the page is reloaded. Stored passwords are untouched — they are hashed separately from any of this — so nobody has to reset one; they simply sign in again.
How to use it
- Paste an existing block, or start from empty. The input is optional. Paste the salt section of wp-config.php only when you have extra KEY or SALT constants you want carried over and regenerated alongside the standard eight.
- Pick the format your setup reads. wp-config.php defines, WP-CLI wp config set commands, .env assignments for Bedrock-style installs, or a JSON object for configuration management.
- Set the length and the characters. Anything from 32 to 128 characters, clamped to that range; 64 is what the official service issues. Switch to letters and digits when something between the clipboard and PHP mangles punctuation.
- Run, copy, then replace the old lines in one edit. Copy output takes the whole set at once. Swapping only some of the constants leaves part of the cookie set still valid and part of it broken, which is a confusing state to debug.
Processing & privacy
Runs on your device. Your file is processed directly in this browser.
Common use cases
Taking over a site from someone else
Anyone still holding the old wp-config.php, together with a copy of the database it belonged to, holds what is needed to mint a valid login cookie. New constants retire that pair.
Ending every session after a compromise
One edit invalidates the login cookies of every account at once, so a stolen session dies without visiting each user in turn or forcing password resets.
Cloning production to staging
The copy inherits production's signing material until you change it. Generating a separate set keeps the two installs from validating each other's cookies.
Several sites sharing one Redis or Memcached
Tick WP_CACHE_KEY_SALT and each install gets its own cache namespace, so an object-cache drop-in cannot hand one site's entries to another.
Questions
Do the generated keys reach a server at any point?
Do I have to use the official WordPress salt service instead?
Will everyone be logged out?
How long should each value be?
Why would I choose letters and digits only?
Can it edit wp-config.php for me?
What happens to extra constants I have defined?
Related tools
- Meta Tag Preview — See how your title and description look in search results.
- wp-config Generator — Generate a wp-config.php with fresh security salts.
- .htaccess Generator — Build common Apache rules for WordPress.
- Serialized Data Fixer — Repair PHP serialized strings broken by search-replace.
- Shortcode Builder — Assemble shortcodes with attributes correctly quoted.
- Theme Header Generator — Create a valid style.css theme header block.