WordPress introduced the Post Revisions feature from version 3.0. It comes handy if you’re running a multi-author blog. But for most WordPress blogs, it doesn’t add much value. Apart from this, the Post Revisions feature can seriously bloat your database with multiple copies of posts. If you are like me, making lots of changes before publishing a post and even after that, post revisions will end up being several times larger than the size of actual posts.
To turn the Post Revisions feature off, simply add the following code to your wp-settings.php
file:
//Turn Off Post Revisions
define(‘WP_POST_REVISIONS’, false );
Before you turn off post revisions, don’t forget to delete the existing post revisions . Use the following SQL query through phpMyAdmin or similar applications. If you don’t have access to phpMyAdmin, install WP DB Manager plug-in. It has an option to “Run SQL Query”. Goes without saying, create a backup of the database and the entire blog before making such changes.
DELETE FROM wp_posts WHERE post_type = “revision”;
Harsh Agrawal says
Another useful tip..
I use post revision WordPress plugin..
This is going to help me lower down the no. of codes.. 🙂
Harsh Agrawal says
Oops!! I mean plugin*
DavidM says
Ha, I was just going to ask, “Aren’t there WP plugins that automate post revision deletion?” And of course, I need to take a look into it because I can just tell by the numbers of revisions on my sites that my database is growing out of control. 🙂