How to delete WordPress post revisions: The following simple solution covers how I delete or remove old post revisions. Back when WordPress 2.6 was rolled out, it introduced a new feature called post revisions. For sites with a lot of posts, this feature can really clutter up the database, at least with how it works in stock form.
Like many others, I am one who prefers full control over this feature using options. Perhaps limit post revisions to 1. Another option is to turn off post revisions, and switch to automatically save posts and pages after so many minutes while editing a post or page.
Anyhow, you could just use a plugin for removing post revisions, but wouldn't learn anything new doing that. With that said, here is one way to manually remove WordPress revisions from your SQL database without using a plugin.
How I Remove or Delete WordPress Post Revisions
To delete all existing WordPress post revisions from the SQL database I'm using phpMyAdmin. Here's how:
- Log into phpMyAdmin from your cPanel or equivalent.
- Locate and select your WordPress database from the phpMyAdmin sidebar.
- Click the SQL tab from the menu, insert the following line of code and click go to apply the changes:
DELETE FROM wp_posts WHERE post_type = "revision";
That's all there is to it, Enjoy! ;)
Now all post revisions related records should have been purged from your SQL database and all revision history should have been deleted. If you feel the need, you can also completely Disable WordPress Revisions to stop new revisions from ever being created again.