Post revision was introduced in WordPress 2.6. Whenever you edit your post or page, a revision is automatically created. Therefore, this is really useful if you want to see changes you’ve made to the article.
Here’s a log of post revisions for one of my articles at WPFeed.com:
However, the problem with post revisions is WordPress does not limit the number of post revision can be stored for each post and page. Let’s do some quick math. Let’s say you have 100 articles and for each article, you made an average of 5 changes per article. That means you already have 500 post revisions stored in your database. That’s a lot.
Therefore, for a long-term, this additional post revisions will slowly increase the size of your database and eventually slow down your site. This is bad.
Deleting Post Revisions
The easiest way to delete ALL post revisions is by using WP-Sweep
plugin. Once activated, go to Tools > Sweep. If you never delete your post revisions before, you will see probably hundreds or thousands of post revisions. It will also provide a lot of other options to optimize your database. Check the image below.
As you can see, I’ve got almost 1000 post revisions! To delete them, I just simply need to hit the blue button.
Disabling Post Revisions
It’s also possible to disable the post revisions feature. However, I do not recommend disabling it since sometimes you might want to to do a comparison of changes you’ve made.
To disable the post revisions feature, paste the following code in your wp-config.php file:
define('WP_POST_REVISIONS', false );
Limiting Post Revisions
Another thing you might want to try is by limiting the number of post revision. Paste the following code in wp-config.php file, where 3 is the number of revisions allowed.
define('WP_POST_REVISIONS', 3);
However, if you are unsure where to find your wp-config.php, you can also use Revision Control plugin. From the plugin settings page, you can set the number of revisions for post and pages or completely disable it. The plugin can also delete post revisions from other posts. However, I found it no to be very practical as you cannot delete them in bulk, instead, you need to delete them one article per time.
Leave a Reply