WordPress

WP Config Generator

Build a readable wp-config.php snippet. Enter your database settings, choose optional constants, then copy or download the settings to review alongside your real WordPress configuration.

Configuration generation runs in your browser. Database credentials are not submitted to the tool API or saved as favorites. Avoid sharing generated files containing passwords.

Loading the tool…

How to use WP Config Generator

  1. Enter the database name, database username, password, and host supplied by your hosting provider. Replace every example placeholder; localhost is not correct for every host.
  2. Open Advanced options only for settings you understand, such as debugging, memory, SSL, and automatic updates.
  3. Generate the snippet and inspect the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST values. Check the remaining constants and supply authentication keys and salts separately.
  4. Copy or download wp-config-snippet.php. Back up your real wp-config.php, merge the relevant settings before its stop editing line, and test changes on staging. The download is not a complete installation file.

Worked example

Illustrative database settings for a new installation. The password below is a placeholder, not a working credential.

Input

Database name: site_db
Username: site_user
Password: replace_with_your_password
Host: localhost

Output

define( 'DB_NAME', 'site_db' );
define( 'DB_USER', 'site_user' );
define( 'DB_PASSWORD', 'replace_with_your_password' );
define( 'DB_HOST', 'localhost' );

This excerpt shows how the database fields map to WordPress constants. The complete generated output includes additional settings. It does not create a database or verify that these credentials can connect.

How the generator works

The generator builds PHP text from your inputs and optional switches. It can include database constants, a table prefix, and settings for debugging, memory, HTTPS, automatic updates, and Multisite. Selecting a constant changes the generated snippet; it does not change your server. Authentication keys and salts are not generated here: the output asks you to add them from the official WordPress salt API or your host secret manager.

WordPress still depends on your actual database, PHP configuration, hosting permissions, and installed extensions. A generated memory value cannot override every hosting limit.

Understand and apply the output

For a new installation, start with the WordPress installation configuration and merge these settings after replacing all placeholders. The snippet omits the full WordPress bootstrap and must not be used as a complete replacement file. For an existing installation, compare values with the current file and preserve custom settings, environment includes, and the existing table prefix.

Authentication keys and salts are secrets. Replacing existing salts invalidates WordPress login sessions. Do not enable public error display on a live site or assume that a generated SSL setting fits a reverse-proxy setup.

Supported inputs and common mistakes

Use the exact database host provided by your host, including a supported port or socket notation when needed. Review characters such as quotes and backslashes in generated PHP strings, and validate PHP syntax before use.

This tool generates configuration text. It does not install WordPress, create users, provision a database, inspect your hosting account, or guarantee that a configuration is safe for every installation. Keep a working backup and a way to restore it.

Frequently asked questions

Can I replace my existing wp-config.php with this output?

Compare the output with your existing file first. Preserve custom constants, environment-specific includes, and the table prefix. Back up the file and test the changes before updating production.

Does the generator test my database connection?

No. It formats the settings you supply. Confirm the database name, user permissions, password, and host with your hosting provider.

What happens if I change authentication salts?

Existing WordPress login cookies become invalid, so logged-in users will need to sign in again. Keep the new salts private.