Turn Off Post Revisions from Wordpress 2.6
Here at devjargon, like most blogs around the blogosphere, we use Wordpress as our platform. We like the ease of development and the relatively fast performance that it gives us. We recently updated to the newest version of Wordpress 2.6, and so far have been fairly impressed with the new additions.
One thing that I don’t like about Wordpress 2.6 is post revisions. Today I’m going to show you how to turn post revisions off so your wordpress database doesn’t get bogged down with useless entries.
I’m not the best writer, I normally take my time and make a number of saves throughout a posts creation. With post revisions turned on, this means that for every save a new database entry is added to the wp_posts table. Now I realize that this really isn’t that big of a deal, but it adds up over time.
Lets say that you’re blog posts 4 times a week and on average saves each post 5 times (I save at least this many). That means that every week, your wp_posts table gets 24 new entries every week (5×4 for each revision and 4 for each final post). This means that your table will have 1248 new rows every year (at a minimum). This will add up with years of blogging and can possibly slow your blog down.
Remove Post Revision Functionality
To actually remove the post revision functionality so that it doesn’t save any revisions you’ll have to add a line to your wp-config.php file.
This will make sure that Wordpress doesn’t save any more revisions of your post.
Remove all revisions from your database
If you’ve already saved a few posts before turning off Post revision, and you want to clean up your Wordpress database you can do the following SQL query through phpmyadmin.
DELETE FROM wp_posts WHERE post_type = 'revision';
This will clean up your database and remove all unwanted revisions. Just make sure that you backup your database first (just in case).
This is really the only feature in Wordpress 2.6 that I don’t like. I love the new plugin functionality, the ability to preview your theme before you go live and pretty much everything else. I just feel that the people over at Wordpress should have given us the ability to turn of Post revisions if we wanted to.