WordPress 2.6 Revision Control

wordpressA new feature of WordPress 2.6 is the introduction of the Post Revision. This feature is by default enabled and without options. In theory, it is a reasonable mechanism to prevent data loss in the event a mistake is made in a revised Post. One may simply revert to a previous Post. However, the annoyance is that the admin has absolutely no control over the Post Revision feature. As a revision is made or a save to the Post additional lines are added to the tables in the database. Creating new Posts may look like http://www.domainname.com/?p=500, http:/www.domainname.com/?p=554 and so on. Before you know it, the naming scheme has got out of control.

A manual method to disable this feature, is offered by Lester Chan. Add the following code to wp-config.php:

define('WP_POST_REVISIONS', false);

Then delete all post revisions by running this query in phpMyAdmin:

DELETE a,b,c<br />
FROM wp_posts a<br />
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)<br />
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)<br />
WHERE a.post_type = 'revision'

A more refined an automatic method is to use a plugin that allows the admins to make decisions as to enable or disable Post Revision or to limit the number of posts.



The plugin is available at http://dd32.id.au/wordpress-plugins/revision-control/

In my testing, I used the above code to delete all existing Post Revisions, then I activated the plugin to manage any future revisions.