WordPress comes with an option that will save old versions of a post you are in the process of writing, A lot of people are unaware of this feature but you may have noticed that sometimes a red box will appear informing you that there is a newer post than the one you are creating.
I am not sure about you but I find this feature very annoying. I have no use for it anyway as I write my posts using Open Office and then just copy and paste it, and I’m assuming there are many people who do this.
There is another problem with this post revision feature, each revision takes up space in your database. I have a growing database and I really could do without every post having numerous revision.
So why not get rid of it?
WordPress do not offer a way to disable it in your Admin settings section so we will have to go under the bonnet, don’t panic it isn’t that hard. But just to be on the safe side back-up your database and save the wp-config.php file first.
1 Open up the wp-config.php file.
2 Add the following code to the file:
You now need to open up your database.
1 Open up PHPMyAdmin (or whatever your host uses).
2 Run the following SQL query:
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = ‘revision’
That’s it. The saved revision should now be deleted from the database and WordPress will not save any more.
Do you like using the post revision option?