Skip to main content
wp-config.org

WordPress

WordPress wp-config.php generator

Build a wp-config.php file for self-hosted WordPress with your database details, new authentication keys and salts, and only the settings you choose. Every option is explained and the preview updates as you go. This wp-config.php generator makes the file and the keys in your browser, so nothing you enter is sent to this site.

  • Explained settings
  • Fresh security keys
  • Live PHP preview

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.

wp-config.php

What you can do

  • Database connection and table prefix

  • Authentication keys, salts and security settings

  • WordPress addresses, content and environment options

  • Redis object cache and reverse proxy HTTPS settings

  • Live preview, copy and download

How to create your wp-config.php

  1. Enter your database details

    Enter the real database name, user, password, host and table prefix for your WordPress site.

  2. Review each step

    Go through each tab, keep only the settings you need and check the full PHP preview.

  3. Back up, then use the file

    Back up your current wp-config.php, then copy or download the new file and test it on your own site.

Build a WordPress configuration you can review

This free wp-config.php generator brings the WordPress configuration options into one form. Start with your database connection, then review security, site addresses, content behaviour and optional integrations. Each setting has an explanation and a recommendation you can weigh up for your own site.

WordPress salt keys: what they do and when to change them

The eight authentication keys and salts sign the login cookies and nonces WordPress uses. Change them after a security problem, or when you want to sign everyone out: every logged-in user has to log in again. The generator makes a new set each time you press Regenerate keys and salts.

Know the limits

Your settings stay in this browser and are never sent to this site. The generator does not choose an operating system or server size, and it cannot connect to your database or check a live WordPress site. The downloaded file holds secrets, so store it privately. An existing site must keep its real table prefix, and changing the authentication keys and salts signs everyone out.

Related tools: set up a Redis object cache, an Nginx config and a MariaDB config for the same server, build the WP-CLI commands to install WordPress, or compare the new file with your current one.

Moving a site to a new address

Use a migration process that is backed up and can be reversed. Test the change first, use tools that keep serialised data intact, and remove temporary migration helpers afterwards. Run these commands in your server terminal, not in wp-config.php:

wp option update siteurl 'https://new-domain.example'
wp option update home 'https://new-domain.example'
wp search-replace 'https://old-domain.example' 'https://new-domain.example' --all-tables --precise --dry-run
  • Address options: the two option commands change the stored home and siteurl values. A WP_HOME or WP_SITEURL set in wp-config.php still overrides them, so update both places the same way.
  • Search and replace: WP-CLI search-replace updates old addresses and keeps serialised values intact. Read the dry run first, back up the database, then run it again without --dry-run. --all-tables can reach other sites that share the database, so choose the table scope with care.
  • Temporary helpers: an update_option() call in a theme or plugin changes the addresses every time it runs. Prefer a one-time command, and if you do use code, remove it straight after the change. Never paste it into wp-config.php.
  • Browser-based tools: search-and-replace plugins and scripts give you a screen for the same database edits. Use a backup, a precise scope and a dry run where they offer one, and delete standalone scripts from the server after use.

Read the WP-CLI search-replace guide before you change a live database.

Settings that belong in a plugin, not wp-config.php

Keep the normal WordPress start-up and the integrations your site needs. The filters below run after WordPress loads, so they go in a plugin or your theme's functions.php. Test the editor and anything that uses the WordPress APIs before you switch features off.

// Turn off application passwords (WP_DISABLE_APPLICATION_PASSWORDS is not a core setting).
add_filter( 'wp_is_application_passwords_available', '__return_false' );

// Stop loading block patterns from WordPress.org.
add_filter( 'should_load_remote_block_patterns', '__return_false' );

// Turn off XML-RPC methods that need a login (this does not block the endpoint itself).
add_filter( 'xmlrpc_enabled', '__return_false' );
  • Application passwords: turn them off only when no connected app needs them, and review your connected apps first. See the WordPress reference for application passwords.
  • Remote block patterns: this changes which patterns the editor offers. It does not stop every outgoing request or change page caching.
  • XML-RPC: the filter turns off XML-RPC methods that need a login. It does not block every method or the xmlrpc.php file, and blocking the file on the server needs its own checks for remote publishing tools. See the xmlrpc_enabled filter.
  • REST API: avoid a blanket block of the REST API for visitors who are not signed in. Public content, the editor, forms and integrations can all depend on it, so plan any restriction route by route and test each workflow.

Frequently asked questions

Where is the wp-config.php file?

In the folder where WordPress is installed, next to the wp-admin and wp-includes folders. WordPress also looks one folder above that, so some setups keep it outside the public web folder.

How do I generate WordPress salt keys?

This generator makes all eight keys and salts in your browser with a secure random source. You can also use the WordPress.org secret-key service, or run wp config shuffle-salts with WP-CLI.

What happens if I change the salts?

Everyone who is logged in is logged out, because their login cookies no longer match. Posts, settings and passwords are not changed.

How do I turn on debugging without showing errors to visitors?

Set WP_DEBUG and WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false, so errors go to a log file instead of the page. Turn debugging off again when you have finished.

Is it safe to use an online wp-config.php generator?

With this one, what you type stays in your browser. Still review the file, keep it out of public code repositories and make sure only the right server users can read it.

Related tools

  • Salt keys

    Generate new WordPress keys and salts for wp-config.php, with an optional WP_CACHE_KEY_SALT.

  • Password generator

    Generate strong passwords and passphrases, check a password’s strength and make its WordPress hash.

  • Nginx

    Generate an Nginx config for WordPress with TLS, caching, HTTP/2 and HTTP/3.

  • MariaDB

    Plan MariaDB memory, connections and durability for WordPress.

Host WordPress on StackMattic

StackMattic sponsors these free tools. If you would rather not set up and look after the server yourself, StackMattic runs managed WordPress and server hosting.