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]
Related Articles You Are Probably Interested In:
I was searching for Blogs about How to Delete WordPress Post Revisions or auto saved posts | OC Blog and found this site. I am interested in your content and I appreciate sites like this.
Thank you for your kind words! Am glad that it helped.
cheers
Josh
Wonderful idea!!! I would like to thank you for informing this here. It will be very useful to me.
Glad that it helped you.
cheers
Josh
Welcome buddy !!
Hi,
Great and thanks for the tutorial but I think you forget to mention that when googlebot crawl the website they will see as a duplicate.
One more thing the command that you write doesn’t work
DELETE FROM wp_posts WHERE post_type = “revision”;
The “revision” should be only contain ‘revision’.
Anyway your article help me a lot on how to delete the autosave in wordpress because many articles I found doesn’t mention that we have to choose a database first before we can delete all revision. lol