WordPress
WordPress salt key generator
Use this WordPress salt key generator to make new authentication keys and salts for wp-config.php, ready to paste, without anything leaving your browser.
- Same format as WordPress.org
- Unbiased secure randomness
- WP_CACHE_KEY_SALT option
Free, no sign-up. It runs in your browser, so nothing you type is sent to this site.
Nothing you enter leaves your browser.
This tool runs in your browser and needs JavaScript. Turn JavaScript on and reload the page.
Salt keys
Paste into wp-config.php
Your output will appear here
Complete the fields to generate valid output.
What the keys and salts do
When you log in, WordPress gives your browser a cookie that proves who you are. The keys and salts are secret ingredients WordPress mixes into that cookie, so nobody can forge one without knowing them. They also protect the nonces that WordPress puts in links and forms to check that an action really came from you.
There are four pairs. AUTH_KEY and AUTH_SALT protect the login cookie for the dashboard, SECURE_AUTH_KEY and SECURE_AUTH_SALT the same cookie over HTTPS, LOGGED_IN_KEY and LOGGED_IN_SALT the cookie that marks you as logged in on the front of the site, and NONCE_KEY and NONCE_SALT the nonces. Each value should be long, random and different from the others. You never need to remember them.
What happens when you change them
Everyone is signed out. Every login cookie made with the old keys stops working, so every user, you included, has to log in again. That is why new keys are the quickest way to end a session someone else may have stolen. Forms left open in a tab may also need a reload, because their nonces no longer match.
Passwords are not changed. Users log in with the same passwords as before. If you think a password was stolen, change it as well.
Check plugins that store secrets. A few plugins use these keys to encrypt settings they save, such as API tokens. After a change you may need to reconnect them.
How to replace the keys safely
- Make a copy of wp-config.php first, so you can put it back if something goes wrong.
- Open wp-config.php over SFTP or in your host’s file manager and find the eight lines that start with
define( 'AUTH_KEY'. - Replace those eight lines with the ones above. Each name must appear only once, or PHP warns that the constant is already defined.
- Save the file. Check that the site loads, then log in again.
Is this private?
Yes. The keys are made in your browser with its secure random number generator, which is the same kind of source WordPress uses. The keys are never sent to this site or anywhere else or saved, and the download is made on your device. The page only tells this site that keys were made, copied or downloaded, so it can count how the tool is used. Keep the keys only in wp-config.php: never share them, commit them to a public repository or paste them into a support forum.
What you can do
-
All eight keys and salts as define() lines
-
The same 92 characters and 64-character length as WordPress
-
Optional WP_CACHE_KEY_SALT for shared object caches
-
Copy, download and regenerate in your browser
-
A plain-English guide to what the keys do
How to replace your WordPress keys and salts
-
Generate the keys
Open the page and eight new keys and salts are ready. Tick the box if you also want a WP_CACHE_KEY_SALT line, and press Regenerate for a fresh set.
-
Replace the old lines
Back up wp-config.php, then replace the eight lines that start with AUTH_KEY with the ones you copied. Each name must appear only once.
-
Save and log in again
Save the file and check that the site loads. Everyone, you included, is signed out and logs in again with the same password.
What the keys and salts protect
WordPress mixes these eight secrets into the cookies that keep you logged in and into the nonces that protect links and forms. Long, random, unique values mean nobody can forge a login cookie. This generator draws each 64-character value from the same 92 characters as the WordPress.org secret-key service, using your browser’s secure random number generator with no bias towards any character.
When to change them
Change them after a hack or a suspected stolen session, when someone with access to the site leaves, or when you copy a site to a new server. Changing them signs everyone out, but no password changes.
To build a whole file, use the wp-config.php generator, and make strong passwords for every user with the password generator.
Frequently asked questions
What do WordPress keys and salts do?
They are secret values WordPress mixes into login cookies and nonces, so a cookie cannot be forged by someone who does not know them. There are four keys and four matching salts: for the dashboard login cookie, the same cookie over HTTPS, the logged-in cookie and nonces.
Will changing them log everyone out?
Yes. Every login cookie made with the old values stops working, so every user has to log in again. Passwords do not change. Forms left open in a browser tab may need a reload because their nonces no longer match. A few plugins use the keys to encrypt settings they save, so they may need reconnecting.
Are these the same as the WordPress.org secret-key service?
They use the same format: 64 characters each from the same 92 letters, digits and symbols that WordPress’s own wp_generate_password() uses, written as define() lines. The difference is that these are made in your browser, so the keys never travel over the internet.
What happens if wp-config.php has no keys?
WordPress makes its own and saves them in the database, in the site’s options. That works, but anyone who can read the database or a database backup can then read the keys. Keeping them in wp-config.php keeps them out of the database.
What is WP_CACHE_KEY_SALT?
It is not part of WordPress itself. Object cache drop-ins such as the Memcached one add it to the start of every cache key, so sites that share one cache server keep their entries apart. It is a label, not a secret. The Redis Object Cache plugin uses WP_REDIS_PREFIX, and reads WP_CACHE_KEY_SALT only when WP_REDIS_PREFIX is not set.
Is it safe to make keys in a browser?
Yes. Browsers have a cryptographically secure random number generator, crypto.getRandomValues, the same kind of source PHP uses for WordPress’s own keys. The keys are never sent or saved: the page only tells this site that keys were made, copied or downloaded, and the name of the site you came from, so it can count how the tool is used. Keep the keys private once they are in wp-config.php.
Related tools
-
Generate a wp-config.php with database settings, new salt keys and explained options.
-
Password generator
New (added recently)Generate strong passwords and passphrases, check a password’s strength and make its WordPress hash.
-
.htaccess
New (added recently)Generate a WordPress .htaccess with security, HTTPS, WooCommerce and caching rules, plus the matching Nginx rules.
-
Generate Redis settings for a WordPress object cache, with matching wp-config.php options.