How to Disable and Remove All Post Revisions in WordPress

Post revisions in wordpress is automatically created every time you edit and create a new post, it seems to be the history of all your created posts and pages, disabling post revisions is really helpful for single author blog and it save space in your database but for multiple authors blog I solely recommend keep revisions enable, for site admin to track posts changes or easily revert the old created post.

To disable post revisions add the code below into wp-config.php file of your theme.

The snippet above wouldn’t remove the old created posts and pages post revisions, to do that just execute this MySQL command.

I recommend doing a back-up first before executing the command below.

If you want to delete all related data, use the SQL query below

If you don’t want to delete all posts revisions and only limit it on each post and pages, simply edit the above code to this one.

Don’t want to touch in PHPMyAdmin?

Don’t worry folks there is a plugin to remove existing posts revisions.

Download the WP-Optimize plugin and install and enable it on your blog.

Go to Dashboard > WP-Optimize and tick Remove all Post revisions. Click on the Process button and all the post revisions will automatically be deleted.

Source: Michael Martin

by Ryan Sutana