Home › Developer Tools › WordPress Salt Generator

WordPress Salt Generator

Generate the eight WordPress authentication keys and salts (AUTH_KEY to NONCE_SALT) with your browser's cryptographic random number generator. Copy them as wp-config.php lines, a .env file, Docker variables or JSON, or paste your wp-config.php to swap them in automatically.

Last updated:

Paste this into wp-config.php

  
Copy keys one by one
ConstantValueCopy

Update an existing wp-config.php

Paste the contents of your wp-config.php. The tool replaces the eight key and salt lines with the new values (and adds any that are missing) without touching anything else. The file never leaves your browser.

Advertisement
Advertisement

How to use the WordPress Salt Generator

  1. Choose the output format: wp-config.php for a normal install, .env for Bedrock-style projects, or Docker variables for the official WordPress image.
  2. Keep the default characters and length (92 symbols, 64 characters) unless your deployment tool has trouble with spaces or $ signs; then pick the shell-safe set.
  3. Press Generate new salts and then Copy all or Download.
  4. Replace the old block in wp-config.php (the lines that start with define( 'AUTH_KEY' … to NONCE_SALT), or paste the whole file into Update an existing wp-config.php and download the updated copy.
  5. Upload the file to your server. All users, including you, are logged out and simply sign in again.

The eight WordPress keys and what they protect

KeyMatching saltUsed for
AUTH_KEYAUTH_SALTThe authentication cookie for the admin area over plain HTTP
SECURE_AUTH_KEYSECURE_AUTH_SALTThe authentication cookie sent only over HTTPS
LOGGED_IN_KEYLOGGED_IN_SALTThe logged-in cookie that marks you as signed in on the front end
NONCE_KEYNONCE_SALTNonces: short-lived tokens that protect forms and links against forged requests

WordPress combines each key with its salt (key . salt) and uses the result as the secret for an HMAC of the cookie or nonce data. If a constant is missing or still says put your unique phrase here, WordPress falls back to random values stored in the database, which works but is weaker if the database leaks.

Where the keys go

  • Classic install: open wp-config.php in the site root and replace the block between Authentication unique keys and salts and /**#@-*/.
  • Bedrock and Dotenv setups: put the lines in .env; the config file reads them with env('AUTH_KEY').
  • Official WordPress Docker image: set WORDPRESS_AUTH_KEY through WORDPRESS_NONCE_SALT in the container environment and the image writes them into wp-config.php.
  • Keep wp-config.php out of public Git repositories, and never reuse the same salts across sites.

How strong are the keys?

Entropy per key = length × log2(number of symbols). With the defaults that is 64 × log2(92) ≈ 418 bits. The shell-safe set (88 symbols) gives about 413 bits and letters and digits only (62 symbols) about 381 bits at 64 characters. All of these are far beyond any brute-force attack; length matters much more than the symbol set.

Frequently asked questions

What are WordPress salts and security keys?

They are eight secret random strings defined in wp-config.php. WordPress mixes them into the hashes that sign login cookies and nonces, so a cookie cannot be forged or reused without knowing the keys. Four are called keys (AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY) and four are salts (AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALT).

What happens when I change the salts?

Every existing login cookie becomes invalid, so all users are logged out and must sign in again. Posts, settings, passwords and the database are not affected. That makes changing salts a quick first step after a suspected break-in.

Are these keys as secure as the official WordPress generator?

Yes. They use the same 92 characters and default length of 64, giving about 418 bits of randomness per key, and they come from crypto.getRandomValues, the browser's cryptographically secure random generator. Bytes that would bias the result are discarded.

Can the keys contain spaces and symbols?

Yes, and WordPress handles them fine inside the single quotes of define(). The default set never contains a single quote or backslash, so nothing needs escaping. If a deployment script or .env parser has trouble with spaces, $, # or backticks, choose the shell-safe set.

How often should I rotate WordPress salts?

There is no fixed rule. Change them after a hack or malware clean-up, when someone with server access leaves, if wp-config.php may have leaked, or as part of regular maintenance if you do not mind logging everyone out.

Can I change salts with WP-CLI instead?

Yes. On a server with WP-CLI, the command wp config shuffle-salts writes new values into wp-config.php. This page is useful when you edit the file by hand, use environment variables, or do not have shell access.

Are the generated salts saved anywhere?

No. They are created in your browser and never sent or stored. Only your format and character choices are remembered on this device. A pasted wp-config.php is also processed only in the page.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Htaccess & Nginx Redirect GeneratorBuild 301 redirects for .htaccess, Nginx and Netlify or Cloudflare _redirects.Password GeneratorCreate strong passwords and passphrases.API Key GeneratorCreate secure API keys and secrets with prefixes, checksums and SHA-256 hashes for storage.Htpasswd GeneratorCreate .htpasswd entries with bcrypt, APR1-MD5 or SHA-1 for Apache and Nginx basic auth.QR Code GeneratorMake QR codes for links, Wi-Fi, email and more.Barcode GeneratorCreate Code 128, EAN-13, UPC-A, EAN-8, Code 39 and ITF-14 barcodes as PNG or SVG.UUID GeneratorGenerate UUID v4 and v7 / GUIDs in bulk and copy or download them.Schema Markup Generator (JSON-LD)Create JSON-LD structured data for FAQ, Product, Article and more.Fake Data GeneratorGenerate mock data as JSON, CSV or SQL.Random String GeneratorGenerate secure random strings and tokens in bulk with any length and character set.MIME Type LookupFind the MIME type for any file extension, or the extensions for a MIME type, in 400+ entries.Cron Expression GeneratorBuild crontab schedules visually, read them in plain English and see the next run times.URL Slug GeneratorTurn titles into clean, SEO-friendly URL slugs: accents, stop words, separators and bulk lines.JSON Schema GeneratorTurn sample JSON into a draft 2020-12 JSON Schema with types, required fields and formats.Gitignore GeneratorBuild a .gitignore from 50+ templates for languages, frameworks, IDEs and OS, merged and deduped.License GeneratorCreate a LICENSE file for MIT, Apache, GPL, BSD, ISC, MPL or Unlicense with your name and year.ULID GeneratorGenerate sortable ULIDs and UUID v7 in bulk, monotonic option, and decode their timestamps.Placeholder Image GeneratorCreate placeholder images in any size, color and text as PNG, JPG, WebP, SVG or data URI.Ads.txt GeneratorCreate or validate ads.txt and app-ads.txt files: seller lines, cert IDs and variables.Docker Run to Compose ConverterConvert docker run commands to docker-compose.yml, or a compose file back to docker run.Dockerfile GeneratorGenerate a production Dockerfile and .dockerignore for Node, Python, Go or a static nginx site.HTML Boilerplate GeneratorTick the options you need and get a clean HTML5 starter template with meta, OG tags and CSS reset.JSON to Zod SchemaInfer a Zod (or Yup) schema from sample JSON with optional, nullable and z.infer types.Linux Commands Cheat SheetSearchable Linux and bash command reference with flags explained, examples and copy buttons.LLMs.txt GeneratorBuild an llms.txt file for AI crawlers: summary and link sections, import from your sitemap.Nano ID GeneratorGenerate secure Nano IDs with custom alphabet, length and count, plus a collision calculator.Nginx Config GeneratorBuild an nginx server block: static site, SPA, reverse proxy or PHP, with SSL, gzip and redirects.OpenAPI / Swagger ViewerView OpenAPI 2/3 JSON or YAML as interactive API docs with validation and an endpoint list.package.json GeneratorFill a form and get a valid, npm-ready package.json with scripts, dependencies and checks.PKCE Code Challenge GeneratorGenerate an OAuth 2.0 PKCE code_verifier and S256 code_challenge, build auth URLs, verify pairs.README GeneratorFill in a form and get a polished README.md with badges, install, usage and license, live preview.Regex GeneratorBuild regular expressions visually from blocks or presets (email, date, phone) and test them live.Commit Message GeneratorBuild Conventional Commit messages with type, scope, body, breaking change and issue refs.Database Schema DesignerDesign tables and relationships visually, then export SQL for MySQL, PostgreSQL or SQLite.Docker Compose GeneratorBuild a docker-compose.yml with a form: services, ports, volumes, env, healthchecks and presets.Dummy File GeneratorCreate test files of an exact size in KB, MB or GB with zeros, random bytes or text.FFmpeg Command GeneratorPick a task and options, get the exact ffmpeg command with every flag explained.Folder Tree GeneratorTurn a local folder or an indented list into an ASCII directory tree for your README.Dockerignore GeneratorBuild a .dockerignore from Node, Python, Go and Java templates, plus your own entries.ESLint Config GeneratorGenerate a flat eslint.config.js for JavaScript, TypeScript, React or Node with rule presets.Git Branch Name GeneratorTurn a ticket ID and title into a clean, valid git branch name like feature/PROJ-12-add-login.GitLab CI Config GeneratorGenerate a .gitlab-ci.yml with stages, jobs, images, cache, artifacts and rules from templates.Jinja2 Template TesterRender Jinja2 templates with YAML or JSON variables using real Jinja2, with clear error lines.JSON Schema Mock Data GeneratorGenerate realistic sample JSON from a JSON Schema: formats, patterns, $ref, seeds and counts.Kubernetes Secret GeneratorCreate Kubernetes Secret YAML from key/value pairs or .env with auto base64, or decode one.Kubernetes YAML ValidatorValidate Kubernetes manifests against the API schema of a chosen version, with error paths.Prettier Config GeneratorToggle Prettier options, preview formatted code live and copy your .prettierrc file.Quartz Cron GeneratorBuild and explain Quartz and Spring cron expressions with seconds, ?, L, W and #, plus next fire times.README Badge GeneratorCreate Shields.io-style README badges for license, version, build and custom labels.Systemd Service File GeneratorCreate a systemd .service unit with ExecStart, user, restart policy, environment and hardening.tsconfig.json GeneratorBuild a tsconfig.json with target, module, strict checks and path aliases, each option explained.Access Log AnalyzerAnalyze Apache and Nginx access logs: top URLs, IPs, status codes, bots and traffic charts.Regex String GeneratorGenerate random test strings that match any regular expression, checked against the real regex.ASCII Table GeneratorTurn CSV or pasted cells into plain-text tables: MySQL, Markdown, Unicode box and reST styles.GitHub Actions Workflow GeneratorBuild a GitHub Actions CI workflow: triggers, matrix, caching, tests, Pages or Docker deploy.Kubernetes YAML GeneratorGenerate Deployment, Service, Ingress, ConfigMap, Secret and HPA manifests with safe defaults.Markdown TOC GeneratorGenerate a linked table of contents from Markdown headings with GitHub-style anchors.OpenAPI EditorEdit OpenAPI/Swagger YAML or JSON side by side with live API docs, validation and download.OpenAPI ValidatorValidate OpenAPI 3.0/3.1 and Swagger 2.0 specs: schema errors, broken $refs, line numbers.Pivot Table MakerBuild pivot tables from CSV or Excel by drag and drop: sum, count, average, charts, export.SQL Query BuilderBuild SELECT queries visually: joins, filters, GROUP BY, ORDER BY and LIMIT, as clean SQL.Truth Table GeneratorType a logic expression and get its full truth table, minterms and canonical DNF/CNF.TypeScript PlaygroundWrite TypeScript with live type checking, see the compiled JavaScript and run it in your browser.Article Schema GeneratorCreate Article, BlogPosting or NewsArticle JSON-LD with headline, authors, dates and images.Event Schema GeneratorCreate Event JSON-LD with dates, venue or online location, tickets, organizer and performers.Google Search Query BuilderBuild advanced Google searches with site:, filetype:, intitle:, exact phrases and date operators.HowTo Schema GeneratorCreate HowTo JSON-LD with steps, tools, supplies, total time and cost, then copy it.Htaccess GeneratorBuild an Apache .htaccess file: HTTPS, www, gzip, caching, error pages, IP blocks, hotlinks.
See all 85 Code Generators & Builders →