How to Easily Delete Old Post Revisions in WordPress

By Raman Sharma

on

WordPress

WordPress launched post revisions in the version 2.6 update and it proved a wonderful feature. Yes, friends, WordPress post revision is really a wonderful feature that stores the record of each saved draft and published article. So, it is very essential at the time when you mistakenly deleted the content of the post you wrote yesterday or previously and even saved the draft. In that case, the revisions feature lets you restore the old versions of your post very easily without losing any single word.

So, anytime you may need to browse your older post revisions to restore one. On the one hand, the post revisions are a wonderful feature, but it still comes with a great deficiency that a common WordPress consumer ignores, i.e. the revisions are responsible for increasing the size of your database.

As I told you, whenever you save a post or a page, a revision is automatically created and stored in your WordPress database. Each additional revision will slowly increase the size of your database. If you save a post or page multiple times, your number of revisions will greatly increase over time. For example, if you have 100 posts and each post has 10 revisions, you could be storing up to 1,000 copies of older data!

The larger size of the database may increase the website page loading time and degrade the performance of the website. So, if you’ve stored a great amount of useless post revisions in your database, you should delete them to free up the space and improve site performance.

How to Delete WordPress Post Revisions Easily

However, the authentic way of deleting your old WordPress post revisions is from PhpMyAdmin but many people especially beginners would not be familiar with PhpMyAdmin and that’s why I’ve come up with an alternative and very easy way to delete your WordPress post reviews.

To delete the old post revisions in WordPress, you use can a plugin called Better Delete Revision, featured in the 10 must-have plugins I considered in 2014. Yes, guys I also use this plugin to delete the old post revisions very easily.

UPDATE: Advanced Database Cleaner is the best plugin for deleting post revisions and the whole database optimization at the moment. I recommend you to try it.

Here are the simple steps to install and use the Better Delete Revision plugin for deleting post revisions:

Step 1: First of all, click on THIS LINK to download the Better Delete Revision. Now, login to your WordPress admin area and upload, install, and activate this plugin.

Activate Better Delete Revision

Step 2: Now, after activating click on Settings (at the same place) or you can also find it inside your WordPress admin area settings. Next, in the Better Delete Revision plugin settings, click on the button “Check Revision Posts” to find the number of revisions stored in your database.

Better Delete Revision

Step 3: Plugin will show you all the revisions stored in your database. To delete these revisions, just scroll down the page to most bottom and click on the button “Yes, I would like to delete them”.

Delete Revisions

It will take a little time (a few seconds taken to delete 364 revisions in my case) depending on several revisions stored in your database and your connection speed.

Anything More I Need to Do?

No! After the above procedure, the post revisions will be deleted successfully from your database automatically and you don’t need to do anything more manually (from PhpMyAdmin).

I hope you will also find this plugin very helpful for deleting your old post revisions from your WordPress blog database to save up wasted space.

Moreover, having this awesome plugin, you don’t need to worry about database optimization or don’t need any other plugin to optimize your database. In fact, with Better Delete Revision, you can also optimize your database very easily in just a few clicks.

Turning off Post Revisions

However, you can delete all the stored WordPress blog post revisions by using the above-mentioned plugin, but can’t stop them from saving more revisions on future updates.

So, you can easily turn off post revisions to be stored in your database by adding a simple code syntax to your wp-config.php file.

define( 'WP_POST_REVISIONS', false);

The above command will restrict WordPress from creating post revisions on updating articles. In case you want to retain the saving of post revisions, then you can set a limited number of revisions to be stored in your database. Just use the following line in your wp-config file.

define( 'WP_POST_REVISIONS', 2);

Here the number 3 means that only 2 post revisions will be stored of each post in your MySQL database even if you update the post number of times.

Share This Post:

2 thoughts on “How to Easily Delete Old Post Revisions in WordPress”

  1. Its a great plugin but if we delete the post revisions, I had an issue, I mean in my posts I inserted a gallery, if we delete the revisions, only the gallery images are deleted in all posts which are having galleries in posts and remaining all are fine, could you give me the solution for this, other than that the plugin is awesome. Thank you –Ram

    Reply

Leave a Comment