Our wp-config.php
file contents should contain the following sections and in the following order:
- Database settings
- Keys and salts
- User defines
- WordPress load
Our user defines should be as follows:
/**
* User defines go here.
*/
define('WP_CACHE', true); // Always true, enables caching
define('WP_CACHE_KEY_SALT', md5(DB_NAME . __FILE__)); // Leave as is
define('WP_DEBUG', true); // True in production, enables PHP messages
define('WP_DEBUG_LOG', true); // True in production, enables logging in wp-content/debug.log, not error_log
define('WP_DEBUG_DISPLAY', true); // False in production, enables showing PHP messages in the browser
define('WP_DISABLE_FATAL_ERROR_HANDLER', true); // False in production, disables WordPress critical error protection
define('SAVEQUERIES', false); // False in production, saves database queries in memory, useful in debugging
define('SCRIPT_DEBUG', false); // False in production, makes WordPress use non-minified script versions, useful in debugging
define('DISALLOW_FILE_EDIT', true); // Always false, disallows wp-admin editing of theme files
define('WP_POST_REVISIONS', 15); // Number, post revisions to keep
define('AUTOSAVE_INTERVAL', 180); // Seconds, how often to save post revisions
define('EMPTY_TRASH_DAYS', 365); // Days, how often to clean trashed posts
define('WP_MEMORY_LIMIT', '256M'); // Memory limit
define('WP_MAX_MEMORY_LIMIT', '384M'); // Admin memory limit
Be careful to set the correct values depending whether the website is in production or development mode.