How to Delete WordPress Revisions

Learn how to delete WordPress revisions properly without messing up your database and without leaving your database cluttered.

When you own a small website keeping keeping tuned is not something people worry, we can’t say the same about running a website that’s has periodic updates, has hundreds of post and that was been online for few years. Your website starts eating more resources and the server suffers from it.

One thing about running a WordPress website (or any other website) is that you should be running periodic backups, specially before making any changes. You never know when you are going to mess things up. That backup can help you restore your website quickly and save you from some headaches.

Creating periodic backups and moving the database around can become annoying. The database can increase in size fairly quick specially if you have been adding content to your website. The things is when you are adding content to your website and writing pages and post, WordPress starts adding revisions of each post to the database, this revisions can increase the database size considerably.

WordPress Revisions

In WordPress 2.6  introduced as “WordPress revision”, this feature creates a copy of the previous version of your post while you edit it. When you have a small website it’s not big of a deal, but with older websites with hundreds of posts it can clutter your database. So I highly recommend to clean up the database every now and then.

How to delete WordPress revisions

There are couple of different methods to delete the post revisions. Many people try to delete WordPress revisions by running a MySQL query in the database using a tool like phpMyAdmin.

The problem with doing so is that it doesn’t solve the cluttering problem a hundred percent. WordPress stores information in two different locations in the database. One in  which the post content is stored and two where WordPress stores the administrative information of each revised post.

With that script you only delete all the post revisions, but it doesn’t delete the administrative information.

I found a plugin that provides a simple an easy solution that with couple of clicks you can get your database clean.

Better Delete Revision

Better Delete Revision is the best plugin you can use to delete all the revisions of the database. It deletes not only the post but also all the meta information of each post. It’s really simple to use, with a couple of clicks you can clean up your database.

Revision Control

In case you don’t want to delete all the revisions, but only some of them or manage some older versions you can always use Revision Control to manage the revisions of your post manually.

WP-Optimize

I didn’t include WP-Optimize in the initial post because it does more than just delete WordPress revisions, but after Allie’s comment I decided to include it in the post. This plugin do a lot of different type of optimizations in the database including deleting revisions without the need of using phpMyAdmin.

Be careful

Remember every time you try to do something with your database that you need to backup the whole database first. You never know when things can go wrong. I’ll be writing a new post in the future how you can backup your blog in many different ways.