How to Delete Post Revisions in WordPress

· 2 comments

in Blogging

Delete Post Revisions in WordPress

Post revisions have often served as a great option for me. It enables you to revert back to an older version of your post and access autosaved drafts of the post you might have messed up irrecoverably.

Post revisions are also handy when you have to recover a blog post when your browser/computer or the internet crashes.

But behind this great feature is a major drawback that it really loads up the database and hence it requires a desired effort to clear off the unwanted post revisions in order to maintain a healthy database.

Disable Post Revisions

Well, I would really not recommend doing this since Post revisions is a handy feature.

But still if you think you can manage without Post revisions and want to save your self from deleting post revisions in order to optimize your database, then you can add the following line of code to your wp-config.php file.

 

define('WP_POST_REVISIONS', false);

 

but if you really don’t wanna totally get rid of the post revisions function and would like to customize it a bit according to your need then you can add the following code to your wp-config.php file.

define('WP_POST_REVISIONS', 5);
define( 'AUTOSAVE_INTERVAL', 120);

This code will make wordpress save just 5 post revisions (change it to meet your needs) and each post revision would be saved at an interval of 120 seconds (you can again edit this number to your preferred interval).

Delete all Post Revisions

If you don’t want to change any default settings but just want to get rid of current post revisions then you can install the Delete Post Revisions Plugin(Click to go to the download page)¬†for WordPress and it will do the rest of the job for you.

Once you install the plugin, the plugin page would look something like this :

 

Delete Post Revisions Plugin

 

It may take time to clear up the database, depending upon the number of your post revisions. Once the revisions are cleared the plugin will show the following message.

Delete Post Revisions Plugin

 

Deleting Post revisions helps optimize your database and hence reduces loading time and keeps your site healthy.

Article by

Editor-in-Chief and Owner of Techfudge. A fun loving guy Aspiring to become a graphic designer and striving to become the coolest geek.

Karan has written 215 awesome articles for us at Techfudge

Write for us a Guest Post!

{ 2 comments… read them below or add one }

TechSkyer July 3, 2011 at

Also, you can use plugins: Wordpress Optimize to Delete all Post Revisions :)

Reply

Techsute@wordpress July 7, 2011 at

But can you suggest how can we save these post revision data in computer memory for future use and then delete from server

Reply

Leave a Comment