Support » Fixing WordPress » How To Delete All Unused Page Revisons?

  • Resolved Dan Poynor


    I need to clean up my SQL output and be able to quickly view just relevant content in dumps and phpMyAdmin while scanning for anomalies for example.

    All the drafts or auto saved versions of posts are competing for attention and taking up screen real estate while I’m trying to view hundreds or thousands of posts at once.

    How do I get rid of those easily?

    Is there a way to turn off the ‘feature’. It’s just causing more noise for me than it’s worth.


Viewing 4 replies - 1 through 4 (of 4 total)
  • The search works, and I found this:

    (keywords: turn off revision – searched here in the forums)

    Hi, search works but there are no answer to this post. I see that I can turn off Revisions and Autosave, BUT I want to DELETE old revisions. Because old revisions are consuming a big amount of database space and are not useful anymore once I posted the definitive entry.
    Can this be performed in any way?

    You need to go into the database and delete the dupes. You’ll find them in the “wp_posts” table.

    They may say “inherit” or “revision” under ‘post_status’ column. Use the ‘ID’ # to figure out which you want to keep and which to delete.

    The plugin at the above link is great. I found a bit of sql there also in a recent comment on how to properly delete the unnecessary revisions in WordPress.

    Run from phpMyAdmin SQL panel…

    DELETE a,b,c FROM wp_ABCXYZ_posts a LEFT JOIN wp_ABCXYZ_term_relationships b ON (a.ID=b.object_id) LEFT JOIN wp_ABCXYZ_postmeta c ON (a.ID=c.post_id) WHERE a.post_type='revision';

    Change wp_ABCXYZ to whatever your table prefix is.


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How To Delete All Unused Page Revisons?’ is closed to new replies.