How to Delete WordPress Post Revisions or auto saved posts

Its important to maintain your database table size and optimize them regularly when your blog is regularly being updated.

Delete and remove all existing stored post revisions and changes made on pages stored in the database in order to reduce the wp_posts table size, especially when there is already tons of revisions or changes been kept.

Method 1

To delete and remove all existing post revisions entries and rows from WordPress database Posts table, simply login to MySQL command-line interface, phpMyAdmin, SQLyog or other MySQL GUI tools. Select the appropriate WordPress database (if you have more than one databases on the same server), and then issue the following command (it’s also recommended to backup the database before performing the deletion SQL statements):

DELETE FROM wp_posts WHERE post_type = “revision”;

Once all post revisions related records is purged, all revision histories is deleted, and users no longer able to check the changes by phase or compare differences between versions.

Method 2

Add the below line to  to your wp-config.php file and  change the 6 to however many revisions you want or -1 to keep them.

define(‘WP_POST_REVISIONS’,6);

Method 3

Also you can use the WP plugin here   to delete old revisions.

Hope you enjoyed the post, let us know your comments

[ratings]

4 Comments

  1. The Method January 3, 2010
    • admin January 6, 2011
  2. admin January 6, 2011
  3. khaleed June 19, 2011