wp-config.php generator
Answer a few questions and get a complete wp-config.php, built in your browser from WordPress's own sample file.
<?php
/**
* The base configuration for WordPress
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/
*
* @package WordPress
*/
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** Database username */
define( 'DB_USER', 'username_here' );
/** Database password */
define( 'DB_PASSWORD', 'password_here' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**#@+
* Authentication unique keys and salts.
*
* You can change these at any point in time to invalidate all existing cookies.
* This will force all users to have to log in again.
*/
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
/**#@-*/
/**
* WordPress database table prefix.
*
* Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
*/
define( 'WP_DEBUG', false );
/* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
What this file is
wp-config.php sits in the site's main folder and tells WordPress where its database is and how to behave. WordPress ships a sample, wp-config-sample.php. The file built here is that sample with your answers filled in, and with the settings you chose added in the place the sample marks for them.
How to use it
- Fill in what you know. Anything left empty keeps the sample's stand-in, which you can replace on the server.
- Save the file, or copy its text.
- Upload it to the folder that holds
wp-load.phpand thewp-adminfolder. - Open the site. A new install continues with WordPress's own setup screen.
On a site that is already running
Keep a copy of the file you have before you replace it, and carry three things over exactly:
- The four database values. A wrong one shows an error establishing a database connection.
- The table prefix. WordPress looks for its tables under that prefix, and with a different one it behaves as if it had never been installed.
- Any lines a plugin or your host added to the old file.
New keys and salts are safe to use on a running site. They log everyone out, and nothing more.
What it does with what you type
The file is put together in your browser as you type. Nothing you enter here, the database password included, is sent to us or to anyone else. If you would rather not type a password into any web page, leave that field empty and put the password into the file on the server.
Common questions
Where do I find the database name, user and password?
Do I have to turn on any of the settings?
Why is the file editor switch there?
What does logging errors do?
Stuck after changing the file?
Put the copy of the old file back first. If the site still will not load, tell us what you see and we reply with the cause and a fixed quote.
Get a free diagnosis
