The default post revision functionality of WordPress is quite good. It keeps every revision you publish saved so that you can revert back to a previous version if required, and it also means that the two posts can be compared (via third party tools) to compare differences… handy if you’re editing somebody else’s work. I’ve also known some people to swap between versions so they compare the SEO effectiveness of the same post styled slightly differently.
The problem?
The problem with the WordPress post revisions is that:
1. The posts can, over time, take up large amounts of MySQL database storage space. Not a big problem if storage is not a problem, but it can impact upon your storage allowance if it is restricted.
2. A large MySQL database can potentially slow down queries. The server will have to process harder and for longer to retrieve results.
If disabling post revisions is important to you, as it is to me, you will find that there’s no default WordPress option to simply turn it off. I’ve had a large number of people ask me why such an important feature isn’t incorporated into the WordPress framework by default… and I now simply point them to a presentation made by Matt Mullenweg of Automattic. Matt says that they want to leave options to the plugin community since they’ll never be able to include even a small set of options by default that will please everybody. By releasing a minimalistic framework optimised for both speed and efficiency, users can then pick and choose any option they require by way of plugins without having default functionality they don’t or won’t use.
Fortunately, preventing the post revisions from being saved is as simple as a simple line of code. Navigate your way to wp-config.php and open it for editing. Add this single line of code anywhere between the php open and close tags. I prefer to keep it up the top.
/* Turn Post Revisions Off */
define(’WP_POST_REVISIONS’, false);

If you ever want to start keeping revisions at any stage, simply delete the line of code.
If you would like to remove existing old revisions from the WordPress database, there are two primary means of accomplishing this; either via phpMyAdmin or via a plugin. Be sure to back up your database first. Every time you play with deleting data from your database you run the risk of inadvertantly screwing the pooch!
Most hosting providers will provide you with access to phpMyAdmin. It’s a tool written in php that allows you to connect with and manipulate databases, tables and data directly. If you don’t know what I’m talking about, this first method may not be right for you.
Once you log into phpMyAdmin, select the ‘SQL’ tab and enter the following line of code into the text box:
DELETE FROM wp_posts WHERE post_type = “revision”;

Now hit the Go button. It’s probably best to backup your database before doing this.
This SQL command will delete all entries from the wp_posts table with a post_type of revision (as opposed to page or post). It’s probably best you edit the wp-config file before doing this so that you don’t start accumulating revision posts after the mass deletion.
The second option you have to assist with the mass deletion and control over revision posts is via a WordPress plugin. A good plugin is Delete-Revision although there are a large number of others that you can try out. Simply download, upload to your plugins directory, activate and try them out (as you would with any other plugin).
If you liked this article, you may also like:
Plain English and easy to understand. Cheers for making my life a whole lot easier.