Limit or Disable WordPress Revisions for Faster Performance

Amanda Lucas
on
August 18, 2018

Keep your WordPress database in shape by limiting or disabling revisions.

Whenever you save a page or post in WordPress it creates a revision. This occurs in both drafts and already published posts that are updated. Revisions can be helpful in case you need to revert back to a previous version of your content. However, they can also hurt the performance of your WordPress site.  On large sites this can add up very quickly to thousands of rows in your database which are not necessarily needed. And the more rows you have the larger your database in size, which takes up storage space.

Follow the steps below on how to delete, limit, and disable WordPress revisions for faster performance.

1. Clean Up Revisions

If you have had a site for a while, the first thing you will probably want to do is clean up and delete potentially hundreds or thousands of WordPress revisions. This is where a lot of the magic happens, and you can free up space in your database. 

I recommend using the free WP Optimize plugin. It lets you clean up your database easily and safely. 

Step 1

Find and install the WP Optimize plugin in the WordPress repository.

Step 2

Select Wp-Optimize from the admin menu and select the options in the first tab. It is recommended that you do keep a backup before performing any actions like this. Choose the options you want to perform and click the blue ‘Run all selected optimisations’ button.

Once its finished you will see a report of all the opimisations carried out.

2. Limit The Number of WordPress Revisions

Step 1

After you have cleaned up your old revisions, the next step is to limit the number of WordPress revisions that you allow. This can be a great stop-gap measure to ensure that the revisions don’t pile up again. Perhaps you want to save 3 revisions. WordPress will keep that number and delete any previous ones. 

Open your wp-config.php file. You will need to add some code. This is typically located in the root of your WordPress site directory and you can access it via FTP.

Important! Editing the source code of a WordPress theme could break your site if not done correctly. If you are not comfortable doing this, please check with a developer first.

Step 2

The code below needs to be inserted above the ‘ABSPATH’ otherwise it won’t work. Again, you can change the number to however many of revisions you want to keep stored in your database per page or post. I find three to be a good number to keep.

define('WP_POST_REVISIONS', 3);

It should look something like the following.

wp post revisions

3. Disable WordPress Revisions (Optional)

The last option you have is to simply disable WordPress revisions altogether. Typically option 2 above is the most commonly used method. However, if you are on a single author site, you might simply want to get rid of them altogether. Remember, it will still save a draft, it just won’t have revision restore points.

Step 1

The steps are the same as limiting revisions above. Open your wp-config.php file.

Step 2

The code below needs to be inserted above the ‘ABSPATH’ otherwise it won’t work.

define('WP_POST_REVISIONS', false);

It should look something like the following.

disable wordpress revisions

Disable WordPress Revisions Using a Plugin

Alternatively, you could also use a free and lightweight WordPress plugin called Disable Post Revision. Simply install it, click into “Writing” in your dashboard, and select the post types for which you want to disable revisions.

disable post revisions

Leave the first comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Amanda Lucas

Amanda Lucas

Amanda Lucas runs a web design agency in Ireland called Itchy Fingers Design. She enjoys creating websites that help support business goals and growth and sharing her knowledge.