Delete and Remove Existing Saved Wordpress Post Revisions

January 11, 2009 · Filed Under Wordpress 
↓ Sponsored Links

Delete and Remove Existing Saved Wordpress Post Revisions

One of the new feature in Wordpress 2.6 and above that irritates me is the post revision. Not only does Wordpress create and stores all the past revision automatically every 10 minutes or so, it causes your server MySQL database to be bloated with unwanted data. Within a few months, your ‘wp_posts’ table will be filled up, clustered, and the post ID will be gigantic. Worst case scenario when you backup your MySQL is to have a 50MB database, too big for uploading in case of server failure.

If you do not need this feature you can easily turn it off by adding one line to your wp-config.php file, found in the installation directory of your WordPress site:

    define(’WP_POST_REVISIONS’, false);

Adding this line to your wp-config.php file does not delete your previous saved post revisions, to remove previous post revision permanently, run this query using the WP-DBManager plugin.

    DELETE FROM wp_posts WHERE post_type = “revision”;

This will get the job done in no time and your database in good shape. Please note that extra precaution is to be taken when amending your database, make sure you keep a good backup copy before proceeding with the amendments.

Related Posts with Thumbnails
Tags: , , , , , ,

Related Articles

Similar posts you may be interested in based on past browsing


 

Comments


  1. Neil Duckett

    February 16th, 2009
    1

    Can`t for the life of me get DELETE FROM wp_posts WHERE post_type = “revision”; to work.


  2. ir

    March 10th, 2009
    2

    delete from wp_posts where post_type=’inherit’

    thank you, that “feature” was indeed very irritating, glad i got rid of it.


  3. problogger 2u2c

    April 28th, 2009
    3

    nice share…hope you can keep sharing

    i never do it before..

    thanks one again

Leave a Reply