What’s a post revision?
Each time you click “Save Draft” or the “Update Post” a post revision will be saved, which is actually a backup of your post so if you decide that your post was better in earlier stage of writing it you can load a post revision.
But the thing is that post revisions might slow your blog down and use more resources, so here is how you can deal with that.
Delete all revisions
The code bellow will delete all the post revisions and all the data associated with the post revisions. This is a SQL query so i suggest you use phpMyAdmin to run it.
DELETE a,b,c 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'
Thanks to onextrapixel.com for the code.
Disable revisions
The code bellow goes in the wp-config.php file located in the root folder of WordPress. It will completely disable post revisions.
define('WP_POST_REVISIONS', 'false');
Limit revisions
The code bellow goes in the wp-config.php file located in the root folder of WordPress. This will limit the number of revisions to 5. It won’t stop making revisions after the 5th one, it will simply delete the oldest automatically and create a new one.
define('WP_POST_REVISIONS', 5);
That’s it. Hope this helps.
Our WordPress themes
We have a few WordPress themes that we would like you to take a look at if you want.
check out the portfolio











Excellent quick tip! Limiting post revisions can be really useful! Thanks!
Thanks! I just deleted 1200 revision posts I’ll never need … hopefully.
Deleting post revisions leave some traces behind. Its not the best way to do it. Take a look at my post – http://blog.ashfame.com/2010/04/handling-wordpress-post-revisions-correctly/