customised wordpress wp-config.php file

Knowledge base article id: 32

Out of the box, the wordpress wp-config.php file is basic and ugly.

Below is our standard wp-config.php file to provide additional features, security and performance.

<?php
################################
//security of files and folders
################################
define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) );

################################
//increase memory limit
################################
define('WP_MEMORY_LIMIT', '1024M');

################################
//empty trash every 14 days automatically
################################
define( 'EMPTY_TRASH_DAYS', 14 ); // 14 days

################################
//automatically optimise the database
################################
define( 'WP_ALLOW_REPAIR', true );

################################
//disable post revisions
################################
define('WP_POST_REVISIONS', false );

################################
//change autosave interval
################################
define('AUTOSAVE_INTERVAL', 30 ); // seconds

################################
// MySQL settings
################################
define('DB_NAME', 'DB_NAME');
define('DB_USER', 'DB_USER');
define('DB_PASSWORD', 'DB_PASS');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', '');

################################
# Authentication Unique Keys and Salts.
################################
define('AUTH_KEY',         'INSERT_KEY_HERE');
define('SECURE_AUTH_KEY',  'INSERT_KEY_HERE');
define('LOGGED_IN_KEY',    'INSERT_KEY_HERE');
define('NONCE_KEY',        'INSERT_KEY_HERE');
define('AUTH_SALT',        'INSERT_KEY_HERE');
define('SECURE_AUTH_SALT', 'INSERT_KEY_HERE');
define('LOGGED_IN_SALT',   'INSERT_KEY_HERE');
define('NONCE_SALT',       'INSERT_KEY_HERE');

################################
# WordPress Database Table prefix.
################################
$table_prefix  = 'wp_';

################################
# For developers: WordPress debugging mode.
################################
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
  • custom wp config, wordpress, config
  • 0 Users Found This Useful
Was this answer helpful?