How to Delete WordPress Post Revisions

How to delete WordPress Post Revisions: The following simple solution covers how I delete or remove old post revisions from the SQL database. 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 2. 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.

Delete WordPress Post Revisions
Deleting WordPress Post Revisions from the SQL database.

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:

  1. Log into phpMyAdmin from your cPanel or equivalent.
  2. Locate and select your WordPress database from the phpMyAdmin sidebar.
  3. Click the SQL tab from the menu, insert the following line of code and press go to apply the changes:
    DELETE FROM wp_posts WHERE post_type = "revision";

That's all there is to it, Enjoy! ;)

Now all existing post revisions and related records should have been purged from your SQL database and all revision history, deleted. If you feel the need, you can also completely Disable WordPress Post Revisions to stop new revisions from ever being created again.