WordPress security keys and salts help protect cookie authentication and nonces. They are secret configuration values, normally defined in wp-config.php. Understanding their role helps site owners invalidate standard sessions without mistaking rotation for complete incident recovery.
Many business owners encounter advice urging them to rotate these keys periodically or after dismissing a team member. However, confusion exists about what updating them actually does. Rotating security keys will not clean an infected database, nor will it reset your database passwords. Understanding the boundary between core session handling, server file protection, and credential management prevents unnecessary downtime and ensures you take the right corrective steps during security maintenance.
What WordPress Security Keys and Salts Actually Do
The standard configuration includes four keys and four matching salts for authentication and nonce functions. Keep them secret and unique. They help verify cookie integrity, but they do not make a stolen valid cookie harmless; HTTPS and broader session security remain necessary.
The WordPress configuration documentation explains these secret values. They are used in authentication and nonce calculations. They should not be confused with the individual salts used by password-hashing mechanisms: rotating the configuration values does not rehash or reset user passwords.
Immediate Operational Impacts of Rotating Your Salts
When you edit your configuration file and replace the existing eight values with fresh random strings, WordPress can no longer validate existing authentication cookies. Because the cryptographic reference point has changed, any signature generated under the previous salts becomes immediately invalid. This triggers specific, predictable consequences across your entire web application:
- Standard cookie sessions: existing WordPress authentication cookies fail validation on subsequent requests. Custom authentication systems may behave differently.
- Invalidation of WordPress nonces: Security tokens generated to prevent cross-site request forgery inside forms and dashboard actions expire immediately, requiring active dashboard editors to refresh their screens.
- Remembered logins: standard remembered WordPress sessions require authentication again. Saved browser passwords are not erased.
- Uninterrupted public browsing: General website visitors viewing static posts, service pages, and catalogue listings without an account experience zero disruption, provided your configuration syntax remains valid.
Securing login access also relies on encrypted connections. Setting up server-side SSL certificates and ensuring administrative traffic uses encryption avoids sending tokens over clear channels, as detailed in the WordPress HTTPS guide.
What Key Rotation Does Not Fix or Protect
It is equally critical to understand what updating your secret constants will not accomplish. Salt rotation is a session invalidator, not a comprehensive remediation tool. Specifically, changing your keys will not:
- Reset user passwords: User passwords stored inside the database remain exactly as they were. A compromised user password will still allow an attacker to log back in immediately after rotation.
- Remove backdoors or malicious code: If an intruder gained file-level access or injected administrative accounts into the database, regenerating salts leaves those modifications untouched.
- Alter database connection passwords: The DB_PASSWORD constant in your configuration controls your web server connection to MySQL or MariaDB; changing your salts does not change or secure your database user credentials.
- Revoke plugin-specific API tokens: Third-party integrations that store independent API tokens in database options or distinct tables do not automatically expire when core WordPress salts change.
For maintaining overall site hygiene alongside manual configuration adjustments, website owners often review operational policies such as how they control WordPress automatic updates.
A Hypothetical Scenario: Handling Staff Offboarding and Shared Credentials
Consider a clearly hypothetical example of a regional equipment supplier in Alberta. The company manages an internal WordPress catalogue edited by three remote inventory contractors and an external marketing freelancer. Over eighteen months, several contractors used personal laptops to log into the administrative panel from home networks and client sites.
When a contractor leaves, revoke that account’s access and sessions, review application passwords and integration tokens, and reassign content as appropriate. Salt rotation can invalidate other standard WordPress cookie sessions, but is only one part of offboarding.
- Demote or delete the departing contractor account from the WordPress Users panel, assigning existing content to a generic company editor.
- Require all remaining active staff to update their individual passwords.
- Generate fresh authentication salts and update the configuration file directly on the hosting server.
Verify the result by testing the former account and reviewing all other access paths. Application passwords, hosting credentials, external integrations and custom sessions require their own revocation steps.
Step-by-Step Manual Rotation Procedure
Use a trusted, documented rotation method supported by your environment. A manual configuration edit needs a backup and syntax checks; a security plugin should be vetted and tested. Do not copy secret values into public logs or tickets.
- Create a verifiable file backup: Connect to your web hosting environment via SFTP or your host file manager. Download a copy of your wp-config.php file to your local computer before editing anything.
- Obtain fresh cryptographic values: Use the official WordPress salt generator service provided by WordPress.org to generate eight completely unique, random string constants.
- Locate the target block: Open your server wp-config.php in a code editor. Locate the section labelled Authentication Unique Keys and Salts, which spans the eight define statements.
- Replace the existing block: Overwrite the eight old definitions with the newly generated definitions. Ensure that each line begins with define and closes with a parenthesis and a semicolon.
- Save with the host’s recommended ownership and file permissions. Protect backup copies as carefully as the live configuration file because they may contain credentials.
Verification and Failure Recovery Checks
Immediately after saving the configuration file, perform three verification checks to confirm website health and session expiration:
- Check public front-end pages: Open an incognito browser window and load your homepage and several subpages. If you see a blank white screen, check your PHP error logs for syntax errors in your configuration file.
- Confirm dashboard redirection: Attempt to visit your admin login URL. The browser should present the standard login screen rather than bypassing it into an active dashboard.
- Log in with an administrator account: Authenticate with your normal credentials. Successful login confirms the new salts are working correctly with your current database password hashes.
If the site returns a 500 internal server error immediately after you save changes, restore your local backup copy via SFTP right away. The most common error is accidentally deleting a closing single quote or semicolon during the paste operation.
Practical Checklist Before Modifying Configuration Files
| Task | Purpose | Responsible Party |
|---|---|---|
| Backup configuration file | Enables immediate recovery if PHP syntax errors occur | Site Administrator |
| Notify internal staff | Prevents lost work during drafting or publishing sessions | Project Lead |
| Review active user list | Identifies stale accounts before revoking active sessions | Site Owner |
| Check file permissions | Restricts unauthorized server-level reading of new keys | Hosting Provider / Admin |
Canada Create™ builds and optimizes WordPress sites for Toronto businesses. Tell us your goals and we will recommend the right setup.
Immediate Next Actions
Open your file manager or SFTP client today and inspect your current configuration file. If your site was migrated between hosts or installed using automated default scripts years ago, check whether the salt constants contain diverse random strings or generic placeholder phrases. If you observe placeholders or have experienced recent staff transitions, schedule a ten-minute maintenance window outside peak business hours to rotate your security keys and verify server stability.
Frequently Asked Questions
What are WordPress salts?
Secret keys in wp-config.php that secure login cookies.
What happens when I change salts?
All users are logged out and must sign in again.
Should I rotate salts after a hack?
Yes, along with passwords, plugins and a full cleanup.
Who can secure my site?
Our website maintenance and security service.

