Graham Walters

A wee site for the things I do

WordPress Define Statements in wp-config.php

There are a few WordPress options you may want to override to help keep your site performing well. These changes will have a bigger impact on a shared host as the database connections are usually slower on these systems. The following settings can reduce the number of database entries and queries. Each setting should be added to your wp-config.php file.

define('WP_HOME', '');
define('WP_SITEURL', '');
define('AUTOSAVE_INTERVAL', 60);
define('WP_POST_REVISIONS', false);
  1. WP_HOME overrides your “Site Address (URL)” from your Settings > General page.
  2. WP_SITEURL overrides your “WordPress Address (URL)” from your Settings > General page.
  3. AUTOSAVE_INTERVAL overrides how often the browser will attempt to save changes to an entry while you are working on it. The default is 60 seconds but it can be changed to whatever you like, just remember to keep it under the server's maximum session time.
  4. WP_POST_REVISIONS sets how many copies of an entry are saved to the database. The default is unlimited but I recommend changing this to a reasonable 3. Alternatively you may disable post revisions completely by setting it to false. Reducing the number of revisions can have a huge performance benefit. Note: The limit will not automatically apply to previous entries until they are re-saved, so I recommend you run a plugin such as Better Delete Revision to delete extra revisions.

To read more about WordPress Define options, I suggest you check out the official documentation.