One of the new features introduced in WordPress 2.6 was a handy little tool called post revisions. In a nutshell this allows you save and track any changes made to a post or page ala Wiki and quickly revert to an earlier version. But what if you are your blog's only author? What if you simply don't want this feature?
It wasn't very long ago the WordPress support forums were filled with threads from people asking how to turn off the feature citing massive growth in the size of the database. While it's true that a single post can result in oodles of revisions being stored depending on how many times you edit a particular post it's not a critical issue as space is relatively cheap these days. On the other hand I understand how some people just don't want the extra clutter. Heck, I've even disabled it on this very blog. So then how do we disable post revisions? Using a plain text editor such as Notepad, open up wp-config.php and add the following line ...
define ('WP_POST_REVISIONS', 0);
To keep your copy of wp-config.php neat and orderly a good place to insert this is right after the following lines ...
define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
This will turn off post revisions but what about the revisions currently stored in the database? This is also easy to deal with. Login to phpMyAdmin and run the following query ...
DELETE FROM wp_posts WHERE post_type = "revision";
Or an even more comprehensive query which will also delete any categories or custom field values assigned to those revisions ...
delete x,y,z
from wp_posts x
left join wp_term_relationships y on (x.id = y.object_id)
left join wp_postmeta z on (x.id = z.post_id)
where x.post_type = 'revision'
It goes without saying that you should backup your database prior to making any changes to it.