DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk11 min

How to Generate and Change WordPress Security Keys and Salts

A practical guide to generating and changing all eight WordPress security keys and salts, with browser and WP-CLI procedures, recovery steps and deployment cautions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Generate a fresh set of WordPress security keys and salts with the official secret-key service or rotate them from the WordPress installation directory with wp config shuffle-salts. Replace all eight constants in the active wp-config.php, keep the file private, and plan for every current login cookie to become invalid immediately.

What WordPress security keys and salts do

WordPress keeps eight related secret values in wp-config.php. Four are authentication keys and four are salts. Together they add unpredictable material to authentication cookies, logged-in state and nonce-related data. The keys provide the enhanced security mechanism; the salts add further random data to the values WordPress generates. WordPress includes all eight constants in a normal configuration by default.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Constant Role
AUTH_KEY Secret material for authentication cookies.
SECURE_AUTH_KEY Secret material for secure authentication cookies.
LOGGED_IN_KEY Secret material for logged-in cookies.
NONCE_KEY Key material used when WordPress creates nonce-related values.
AUTH_SALT Additional random data for authentication values.
SECURE_AUTH_SALT Additional random data for secure authentication values.
LOGGED_IN_SALT Additional random data for logged-in values.
NONCE_SALT Additional random data for nonce-related values.

They are not passwords that visitors type, and they are not a substitute for updating WordPress, themes or plugins. Their main operational benefit is that replacing them invalidates existing cookies. That makes rotation useful after a suspected configuration disclosure, an incident involving an administrator account, or a handoff where old operators should no longer retain session access.

Prepare safely before rotating values

A key rotation edits a live PHP configuration file. Prepare a recovery path before changing anything.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
  • Make a tested backup. Copy the current wp-config.php to a protected location and confirm that you can restore it. A backup that has never been tested is not a reliable rollback.
  • Identify the active file. The file is normally in the WordPress installation root, but WordPress can load it from a configured location and the hardening handbook notes that it may also be stored one directory above the installation. In multisite, containers or scripted deployments, verify which file the running application actually loads.
  • Schedule a maintenance window. All current sessions expire together, so editors, administrators and integrations that rely on a WordPress login will need to authenticate again.
  • Check how configuration is managed. If deployment code, an image build, an environment template or a secret store generates wp-config.php, plan to change that source as well as the live file. Otherwise the next deployment can silently restore the old values.
  • Keep the secrets private. Do not paste generated lines into support tickets, screenshots, public repositories or chat rooms. Anyone who obtains them may interfere with session security.
  • Confirm access. Have a working administrator login, hosting-console access or shell access available before you begin, along with a way to inspect PHP error logs if the site fails to parse the file.

Method 1: use the official WordPress key generator

This method works when you can securely edit the configuration file but do not have shell access. The WordPress core sample file references the official generator at https://api.wordpress.org/secret-key/1.1/salt/.

  1. Back up the active configuration. Save a copy of wp-config.php outside any publicly served directory, and verify its contents can be restored.
  2. Open the active wp-config.php. Use the installation root or the configured location you verified during preparation. Do not edit an unused sample file or a template that is not connected to the running site.
  3. Open the official service over HTTPS. It returns a complete set of eight define() statements. Generate a new set for this installation rather than copying the illustrative values shown in WordPress documentation. Documentation examples are examples, not secrets.
  4. Select the existing eight definitions. They begin with define( 'AUTH_KEY' and end with define( 'NONCE_SALT'. Keep the constant names and the surrounding PHP structure intact.
  5. Replace the block with the generated lines. Preserve the opening and closing PHP delimiters, quotation marks, commas and semicolons. Do not add smart quotes, rich-text formatting or accidental characters from an editor.
  6. Save with restrictive access. The web server must be able to read the file, but unrelated users and processes should not. Never place a second copy in a web-accessible directory.
  7. Test immediately. Load the public site, open the administration sign-in page and sign in with a known administrator account. Exercise critical functions such as publishing, media uploads and any integration that authenticates to WordPress.
  8. Notify users. Tell every user that a new sign-in is required. WordPress states in its core sample file: "You can change these at any point in time to invalidate all existing cookies."

Editing details that prevent common mistakes

Do not change the constant names, remove a comma, or leave one old definition mixed with seven new ones. The generated text is PHP source, not a value to paste into a settings field. If your editor adds a byte-order mark or converts quotation marks, use a plain-text or code editor and check the file before uploading it. Keep the generated values exactly as returned; trimming characters or adding spaces inside the quoted strings changes the secrets.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Method 2: rotate with WP-CLI

WP-CLI is usually the better choice for repeatable administration, remote maintenance and deployment automation. From the WordPress installation directory, run:

wp config shuffle-salts

The command refreshes the salts and keys in the wp-config.php used by that WordPress installation. Run it as the system user and in the environment that owns the live site; running it in a development checkout does not rotate production values.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Inspect the target before and after

These related commands help you establish which file and environment you are changing:

wp config path
wp config list
wp config get AUTH_KEY --type=constant

wp config path identifies the configuration path WP-CLI is using. wp config list displays recognized configuration entries, while wp config get can retrieve a named constant when you need to verify that a definition exists. Treat any command output containing secret values as sensitive terminal data; do not paste it into logs or tickets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a controlled shell procedure

  1. Change to the production WordPress directory or supply the correct path in your normal WP-CLI invocation.
  2. Confirm that the command resolves to the intended site and configuration file.
  3. Capture a protected backup of wp-config.php before running the rotation.
  4. Run wp config shuffle-salts once.
  5. Check the command’s exit status and inspect the file for intact PHP syntax without publishing its secrets.
  6. Open the site and administration login, then sign in again and test critical workflows.
  7. Update the deployment template or secret store if it owns the file, and record the change without recording the secret values.

Browser generator or WP-CLI?

Both approaches ultimately replace the same eight constants. Choose according to the access and controls available to you.

Consideration Official browser generator wp config shuffle-salts
Operator access Secure file-editing access and a browser; no shell required. Shell access, WP-CLI and permission to modify the target installation.
Repeatability Manual replacement each time, with greater opportunity for copy-and-paste errors. One documented command that can be repeated consistently.
Auditability Depends on your change-management record and protected backup. Fits shell history, deployment logs and approved maintenance workflows, provided logs do not contain secret values.
Automation Not well suited to unattended rotation because a person must transfer generated text. Can be incorporated into an approved maintenance script or runbook.
Rollback Restore the saved file, then retest PHP and login access. Restore the protected pre-command backup, then retest; do not assume rerunning the command reverses anything.

The browser method is appropriate for a one-off change on managed hosting. WP-CLI is preferable when you maintain several environments, need a repeatable runbook or must rotate during an incident. Neither method is safer if the operator exposes the resulting values or edits the wrong configuration file.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

What changes when you replace the eight values

Existing authentication cookies no longer validate against the new key and salt material. Administrators, editors, customers and other logged-in users are sent through sign-in again when their old cookies are checked. Nonce-related values generated with the old material also stop being accepted, so an already-open form or action may need to be reloaded.

Expect a short burst of sign-in activity after the change. Password managers, single sign-on connections and external tools may ask for authorization again if they depended on a WordPress session. Coordinate with the people who publish content or operate integrations, and avoid starting a deployment that overwrites the file while users are reconnecting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Rotation does not delete user accounts, change passwords, modify database content or repair a compromised plugin. It invalidates cookies that depend on the old values. A stolen password, vulnerable extension or excessively privileged account remains a separate problem and requires its own response.

When rotation is useful—and what it cannot fix

Useful situations

  • You suspect that wp-config.php or a backup containing it was disclosed.
  • An administrator, contractor or hosting operator who may have retained session access leaves the project.
  • You are responding to an incident and want to invalidate currently issued cookies as one containment action.
  • You discover that the site is still using shared, copied or otherwise untrusted values and can replace them with unique generated values.

Limits of a key change

  • It does not patch WordPress core, themes or plugins.
  • It does not remove malware, web shells or unauthorized users.
  • It does not revoke application passwords, reset ordinary account passwords or correct weak file permissions.
  • It does not replace least-privilege administration, backups, monitoring, updates or server hardening.
  • It does not guarantee that an attacker is gone if the attacker still controls code or an account that can rewrite the configuration.

During an incident, preserve evidence and coordinate the rotation with password resets, plugin remediation, access review and malware cleanup. If you rotate first and investigate later, keep the pre-change backup protected so it does not become a second source of leaked secrets.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Protect wp-config.php after the change

The configuration file contains database credentials as well as the eight key and salt values, so it deserves the same protection as any other production secret. The WordPress hardening guidance says the file may be placed one directory above the WordPress installation and should generally be readable only by its owner and the web server. It also documents server rules that deny web requests for the file.

  • Set filesystem ownership and permissions so ordinary users cannot read the file.
  • Configure the web server to deny direct requests for wp-config.php; a correctly configured PHP server should not serve its source, but an explicit deny rule is an additional safeguard.
  • Keep backups, container layers and deployment artifacts that contain the file out of public storage and shared downloads.
  • Use a protected secret store or environment-specific template when your deployment system supports one, and restrict who can read or change it.
  • Review web-server, hosting-panel and source-control access whenever an operator changes.
  • Redact key and salt values from diagnostics, support exports and configuration-management logs.

Troubleshooting after a rotation

The site shows a PHP parse error or a blank page

Restore the tested backup immediately if the site cannot load. Then compare the edited block with the generated output and check for missing quotes, commas, semicolons or PHP delimiters. Reapply the values with a plain-text editor, save, and test again. If a deployment process rewrites the file, correct its template before restoring service or the parse error may return.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Everyone is unexpectedly logged out

This is the expected effect of changing the values, not evidence that the rotation failed. Ask users to sign in again and reload pages containing stale forms. If only some users cannot return, investigate account, password, single sign-on or plugin-specific issues separately.

The new values appear to vanish after deployment

Find the system that owns the file: an image build, configuration template, infrastructure script or secret store. Update that source, redeploy deliberately, and verify the active path with wp config path. Editing only a generated live file is temporary when automation is authoritative.

WP-CLI reports that the wrong site was changed

Stop and restore the correct backup if necessary. Run the command from the intended installation directory, verify the path and environment, and ensure that container volume mounts point to the production configuration. In multisite, distinguish the network’s shared configuration from any separate application or container instance before repeating the operation.

An integration stops working

First test a normal administrator sign-in and the public site. Then reauthenticate the affected integration if it uses a WordPress cookie or nonce. Do not immediately revert the rotation merely because a session expired; reverting restores the old secret and may undo the containment benefit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Multisite, containers and managed deployments

WordPress multisite commonly shares one wp-config.php across the network, so changing the constants can invalidate sessions for every site that uses that file. Tell network administrators and site owners in advance. If separate containers or releases mount different configuration files, rotate the instance that serves real traffic and then update the image or secret source used for future instances.

Blue-green and rolling deployments need special care. During a transition, every serving instance must use the same intended set of values or users may appear to log in and then be rejected by another instance. Change the authoritative secret source, deploy consistently, and test through the load balancer rather than only against one container.

Verification checklist

Complete these checks without exposing the generated strings:

  • The active configuration path was identified.
  • A restorable pre-change backup exists in protected storage.
  • All eight constants were replaced, with no old definitions left in the active block.
  • The PHP file has valid syntax and restrictive ownership and permissions.
  • The public site loads without a configuration error.
  • An administrator can sign in with the new session.
  • Publishing, media and other critical workflows work.
  • Users and integration owners were told that old sessions expired.
  • Deployment templates, secret stores and container images will not reintroduce the old values.
  • No key or salt value appears in logs, screenshots, tickets or repositories.

Place rotation in a broader hardening plan

Use unique generated values for each independent WordPress environment rather than copying production secrets into staging or development. Limit access to the configuration file, keep WordPress and extensions current, remove software you do not use, enforce strong account authentication and review administrator privileges. Maintain tested backups and monitor for unexpected file changes. Those measures address weaknesses that changing keys and salts alone cannot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no need to rotate on a schedule that creates avoidable disruption when there is no change in risk. A documented, event-driven procedure is more useful: define who can authorize a rotation, where the protected backup is stored, how users are notified, how integrations are reauthenticated and how the deployment source is updated. When disclosure or an operator change occurs, the procedure lets you invalidate existing cookies quickly without improvising on a live site.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.