Try the Most Addicted Game - Real Rocket Racing 3d Game

Monday, July 25, 2011

Pin It

Widgets

Delete Post Revisions in WordPress

You delete post revisions in WordPress blogs in simple way. Post revision is a cool way in which WordPress autosaves your posts while you type. This helps to recover the 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. 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 took the plugin over 20 minutes as we had over 8000 post revisions and we had to repeat 3 times till we got the message that no post revisions could be detected.

So now our databases is much cleaner and lighter as we have deleted unnecessary post revisions and have modified good settings for post revisions to work well in future.

0 comments

Post a Comment