How To Delete Wordpress Post Revisions

You may want to read our latest article Best posts on Bloghonour from Dec 2008

Wordpress introduce post revision feature since version 2.6. It helps us to keep revisions of our posts and we can restore to previous revisions anytime.

Although this is a great feature, but what happen if you accumulate too many revisions? Probably your server will takes longer time to query and processes database requests. That means, your blog will load slower and your visitors may wait longer before the content comes out.

So, we may want to delete unwanted post revisions. This can be done by logging to phpMyAdmin and execute the SQL command, or use a plugin.

SQL command to delete post revisions

Here, i would assume you know how to login to your phpMyAdmin and know how to execute SQL command. So, simply run this SQL command and all stored post revisions will be deleted.

DELETE FROM wp_posts WHERE post_type = “revision”;

Use Delete Revision Wordpress plugin

This is an easier method. Just download the Delete Revision plugin and go to your Settings->Delete-Revision to delete them.

Press the Check Redundant Revision button and the plugin will automatically search for post revisions.

Remember, both the SQL command and delete-revision plugin will delete all your post revisions, and you are not allow to choose which revesion to be deleted. So, please make sure you won’t regret after delete them!

Tips: You can turn off post revision feature by go to your wp-config.php and add define(’WP_POST_REVISIONS’, false); before the closing ?> tag.

Tags: , , , ,

You may be interested in reading these articles

6 Comments so far...

  1. ghprod

    If someday ur sql server get bump maybe this tips willbe usefull :)

    Thnx

  2. dicky

    @ghprod -
    I am not sure when my server will get bump, but i just feel don’t want to have unnecessary data in my database.

  3. Tschai

    I did this in SQL until now, but was looking for a plugin.

    Thnx for the plugin.

  4. dicky

    @Tschai -
    Hi, both the plugin and SQL are great. But i am looking for plugin which can delete selected post revisions. Do you have any idea?

  5. Tschai

    Originally Posted By dicky@Tschai -
    Hi, both the plugin and SQL are great. But i am looking for plugin which can delete selected post revisions. Do you have any idea?

    Dicky, I wouldn’t know about a plugin for that.
    I think you should consider SQL in those cases…or tweak the above plugin yourself.

  6. dicky

    @Tschai -
    Yup, this is what i planning to do. But currently i am busy designing my theme, so i would like to see if there is a plugin which can save my development time.

Leave a Reply