Last week I showed you how to control the number of revisions that are saved for each post using the Revision Control plug-in.
That stops too many revisions being saved in the futures, but I suspect that most of you reading this will already have a blog running, and will therefore have quite a number of revisions already in the site’s database. Since the database is searched every time a post is displayed, it makes sense to remove these revisions as well so as not to slow down the time it takes to retrieve the post.
For this task there is a plug-in called Revision Cleaner, that allows you to remove all of the revisions on post that have been published for longer than a certain number of days.
Revision Cleaner is in the WordPress repository, so it can be installed from an administrator’s account:
Once activated, it is possible to set the global values for the clean-up operation, or let each user decide how long to leave the revisions in place for.
The clean-up threshold is set in days and hours.
Revisions on draft posts and not affected, as long as this box remains ticked.
With both plug-ins in place, the database should not grow too fast, as the drafts will have their revisions limited by Revision Control, and once published Revision Cleaner will take care of the rest.