Skip to content

Instantly share code, notes, and snippets.

@jfitzsimmons2
Last active October 21, 2015 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jfitzsimmons2/2713ddfa23b26416efe4 to your computer and use it in GitHub Desktop.
Save jfitzsimmons2/2713ddfa23b26416efe4 to your computer and use it in GitHub Desktop.
My boilerplate wp-config.php file for working locally with WordPress
<?php
if ( file_exists( dirname( __FILE__ ) . '/wp-local-config.php' ) ) {
include( dirname( __FILE__ ) . '/wp-local-config.php' );
define( 'WP_LOCAL_DEV', true ); // We'll talk about this later
} else {
define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');
define('DB_HOST', 'localhost');
}
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
// https://api.wordpress.org/secret-key/1.1/salt/
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');
$table_prefix = 'wp_';
define('WPLANG', '');
define('WP_DEBUG', false);
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
require_once(ABSPATH . 'wp-settings.php');
<?php
//Local DB credentials
define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');
define('DB_HOST', 'localhost');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment