How to Delete Post Revisions WordPress

Following yesterday's post about Turning Off Post Revisions today I'm going to show you how to delete those revisions from the data base.

It's very simple. Open your PhpMyAdmin or wherever you can administrate your data base and run the following query:

Note: Backup your data base before continuing!
Note 2: please notice that maybe your tables tag are diferent. If your table is called XX_posts and not wp_posts just change that in the query.

DELETE FROM wp_posts WHERE post_type = "revision";Code language: JavaScript (javascript)

Running this query in my personal blog time ago it deleted about 10,000 revisions 😉


  1. Jexweber says:

    I have WP-Optimize plugin for wordpress, you can remove all post revision easily.
    I prefer save all post revisions and if is necesary recover one post lost.

    1. quicoto says:

      In fact you’re not losing any post just the X revisions of that post.

      For me it’s useless to have 20 revisions each post 😉

      Thanks for commenting Jexweber.

      1. Jexweber says:

        Yes I know, but I want have post revisions and then erase it when I want, I’ve lost many post for I’ve not active post revisions.

Leave a Reply

Your email address will not be published. Required fields are marked *