WordPress Revision Control
In WordPress version 2.6 and later, multiple revisions are automatically saved for all pages and posts. I allowed this to happen for a long time, but have started to take notice of the large numbers of revisions that I have amassed. The individual pages on this site each had several dozen revisions saved. I find this to be a waste of space in the database. I have no intention of ever reverting to a previous page or post state. I decided to eliminate them. The problem is that WordPress doesn’t offer a toggle in the dashboard interface to turn off the revision feature.
I’ve looked at many different ways to disable it and delete past revisions. After some digging around, I settled on the easiest solution for each. They are as follows.
First, to disable revisions, use the Revision Control plug-in for WordPress. It has a range of settings beyond a simple on/off switch. It’s free and simple to use. I used it to disable revisions entirely across the board. (Note: Disabling does not delete revisions which you have already stored.)
Now, to delete ALL of the revisions that are already stored in the database, follow the instructions below:
- Login to phpMyAdmin for your database access
- Select your WordPress database from the phpMyAdmin sidebar
- Click the SQL tab on the menu. Insert the following line of code and click to apply:
DELETE FROM wp_posts WHERE post_type = “revision”;