How can you delete post revisions in WordPress blogs? Post revision is a cool way in which WordPress autosaves your posts while you type. This helps to recover posts should your browser crash, or internet crash, and you can always restore an older version of the post. But Post revisions tend to pile up in your database.

Most of times the number of post revisions is double the number of posts! No wonder the database file size is growing so fast. Every post we edit keeps accumulating post revisions. If there are frequently edited posts, the revision can be a large number.

Optimize Post Revisions

Of course you can stop post revisions by adding the following to wp-config.php (in root of your WordPress installation)

define('WP_POST_REVISIONS', false);

But post revisions have really helped me recover crashed posts, so I want to continue using them. So I add these to wp-config.php instead.

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

This saves only the latest 3 post revisions of any article (note false is replaced by 3, you can add a different value if you like), so multiple edits will not pile up these post revisions. Next I increased the autosave interval to 120 seconds (default is 60 seconds). So this lets me continue using post revision with decreased saves and only latest saves. But this does not delete my 8000+ useless post revisons over 3-4 years old, which I no longer need.

Delete Post Revisions

Download the Delete Post Revisions Plugin and it will delete all the post revision there are. This is how the admin panel of the plugin looks like. We did not click the check box as there were too many revisions. There is only 1 button and that does the job.

It take ~ 20minutes for the plugin to clean 6000 – 8000 post revisions and might need to call it several times till you get the message that no post revisions could be detected.

Leave a Reply

Your email address will not be published.

17 − 10 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like

20+ Cool WordPress Slider Plugins

For WordPress website owners WordPress slider plugins is a great way to feature content like images, videos etc. on e.g. front pages where the space is limited. Slider typically work as a stack of preloaded content that transition in and becomes visible for the visitor. There are many ways to do this and often cool animated transitions are used to catch the attention of the visitor.