WP-Config Options You Probably Didn’t Know About

1. Override options “siteurl” and “home”

define('WP_SITEURL', 'http://your-sites-address.com');
define('WP_HOME', 'http://your-sites-address.com');

2. Revisions

define('WP_POST_REVISIONS', FALSE);
define('WP_POST_REVISION', 3);

3. AutoSave Interval

define('AUTOSAVE_INTERVAL', 160);

4. New wp-content location

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/somewhere/wp-content' );
define( 'WP_CONTENT_URL', 'http://server.com/somewhere/wp-content');
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/somewhere/wp-content/plugins' );
define( 'WP_PLUGIN_URL', 'http://server.com/somewhere/wp-content/plugins');

5. Manage cookie options

define('COOKIE_DOMAIN', 'www.server.com');
define('COOKIEPATH', 'www.server.com/' );
define('SITECOOKIEPATH', 'www.server.com/' );
define('ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin');

6. Debug options

define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', false);
define('SCRIPT_DEBUG', true); // Enables debugging of WP's built-in Javascript
define('SAVEQUERIES', true); // Saves database queries to $wpdb->queries array for analysis (will slow down site)

7. Memory Limit

define('WP_MEMORY_LIMIT', '64M'); // Probably will be overridden by server settings, but worth trying if you get a memory error

8. Cache

define('WP_CACHE', true); // Basically just includes drop-in advanced-cache.php

9. Custom wp_users and wp_user_meta tables

define('CUSTOM_USER_TABLE', $table_prefix.'a_new_users_table');
define('CUSTOM_USER_META_TABLE', $table_prefix.'a_new_usermeta_table');

10. Override default file permission

define('FS_CHMOD_DIR', (0755 & ~ umask())); // Untested - use at your own risk...
define('FS_CHMOD_FILE', (0644 & ~ umask())); // Untested - use at your own risk...

11. FTP and SFTP Constants

define('FS_METHOD', 'ftpext');
define('FTP_BASE', '/path/to/wordpress/');
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
define('FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub');
define('FTP_PRIKEY', '/home/username/.ssh/id_rsa');
define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', 'ftp.example.org:21');

12. Proxy access

define('WP_HTTP_BLOCK_EXTERNAL', false);
define('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org');

Leave a Reply