Take Out the Trash — WordPress Revisions

We recently did a post on a set of recommended practices to maintain your WordPress-based website to keep it secure, optimize performance, and to make it easier to work with. One of the areas of opportunity we highlighted was WordPress revisions including cleaning out old revisions of posts and pages. This post will explain this in a little more detail and walk through steps not to to clean out old ones, but to limit the number of revisions created without giving up the ability to have them.

Let’s start with a short overview of WordPress revisions. Every time you create or update a WordPress post or page, a revision is created. WordPress also automatically creates a revision of anything you are working on every minute. This is a powerful feature that lets you go back if you changed or deleted something in error. It also provides a way for you to potentially “recover” changes you made that were not saved. You may have seen this if you lost your place and when you come back WordPress prompts you about a later version of a post or page.

While these are very useful capabilities, most people creating content probably don’t need to go back 65 revisions for a particular page or post like the example for from a recent set of updates to our own site, outcomelabs.com, shown above. As we laid out in the Under Your Hood post, these should be cleaned out and a limit put on to minimize the impact of using this feature on the performance of the site.

Wordpress revisions example

There are multiple ways to clean old revisions out of your database depending on your skills and preference. Here at Outcome Labs, we have the ability to monitor and clean these built into the operation platform we use to manage WordPress sites. Most people will use a plugin. Our preferred choice for a plugin to support this is called WP Sweep. This plugin will give you an report on how many revisions there are and let you erase the. Many WordPress developers prefer to use the database utilities in MyPHPAdmin to perform these kind of tasks. Others use the WordPress CLI (command-line-interface) to clean out revisions. Regardless of the method you use, be sure you back up your site before starting.

Once you have cleaned up your database, we recommend setting a limit on revisions to keep your site tidy. You can do this by adding the limit to your wp-config.php file. You can turn revisions off completely, but we recommend keeping the feature on, but setting a small limit ( 3 to 5 ). The example below will limit revisions to the three latest. You can also change the autosave interval to save less revisions, but we think a simple limit is the best strategy.

define(‘WP_POST_REVISIONS’, 3);

Here are a couple of articles which give detailed overviews of this subject. They are worth reviewing if you are looking at improving the performance of your wordpress site.

WordPress Revisions: How to Use and Optimize Them on Your Website

How To Disable And Remove Old Post Revisions In WordPress

Outcome Labs Call to Action

See something of interest?

Get in touch with us today and let’s talk about how we can help your business.