Have you ever saved a post on your blog only to realize later that you accidentally erased a critical paragraph?No right? but in wordpress this is possible.wordpress automatically save that post whenever that post is edited.A new row will be created in wp_posts table. Hence if your posts or pages got edited 10 times, you will have 10 new rows in wp_posts table.so post revision feature of word press is very useful.but they also increase the size of your MySQL database.At this time You can surely delete the post revision one by one manually but it tends very long and boring work.
So Now we found a solution to overcome this problem using a simple SQL Query.and you can’t believe the result you found if you have lots of posts.And also Your database size will be reduced by half!so to use this solution you just have to follow 2 basic steps given below.
1) Log in to phpMyAdmin and select your WordPress database.
2) Click the “SQL” button. Paste the following code in the SQL command window:
DELETE FROM wp_posts WHERE post_type = revision' ;
3) Its done now…!!! It depends on how many posts you had in your WordPress database, you may have saved lots of precious space!
The wp_posts table has a field named post_type. This field can have one of many values, such as “post,” “page” or “revision.” When we want to get rid of post revisions, we simply run a command to delete any entry in the wp_posts table in which the post_type field is equal to “revision”.
And if you think that this feature is just a space consuming because whenever a post edited and a new row will be created in wp_posts table. Hence if your posts or pages got edited 10 times, you will have 10 new rows in wp_posts table.so as a solution of this problem if you want to delete the post revision feature it self.Then you add this following code to wp-config.php:
define('WP_POST_REVISIONS', false);
But Be sure to back up your database first before performing any queries in phpMyAdmin.