Skill: Advanced
Estimated Time to Complete: 15 Minutes
Post Revisions is a feature in WordPress which saves all the modifications made to posts. If something goes wrong in your post, Just go to
Revisions of that post and you can revert them back. Post Revisions play main factor in increase the size of your WordPress database. Due to these Post Revisions size site performance declines.
You can remove all your Post Revisions by executing a simple SQL query via PHPMyAdmin. There is a plugin called Delete Post Revisions.
But instead of using a plugin you can run the following query. If you have some experience on how to execute SQL Queries, you can do this easily. But if you are doing this for the first time then do it with extreme caution as it could crash your database. To execute this query, Login to your PHPMyAdmin and click on the SQL Tab and paste the following query:
DELETE FROM wp_posts WHERE post_type=’revision’;
You can also disable Post Revisions feature permanently. To turn off Post Revisions feature go to wp-config.php:
define(‘WP_POST_REVISIONS’, false);
Once the above Delete Query is executed in PHPMyAdmin it can be no longer accessible to the users. Cleaning Post Revisions once or twice in a month optimizes the Site Performance. But beware, You backup all the data before executing this query.