Ready to get started?Download WordPress


[resolved] How To Delete All Unused Page Revisons? (5 posts)

  1. danpoynor
    Posted 5 years ago #

    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.


  2. moshu
    Posted 5 years ago #

    The search works, and I found this:

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

  3. Marcelo Pedra
    Posted 5 years ago #

    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?

  4. corelogik
    Posted 5 years ago #

    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.

  5. danpoynor
    Posted 5 years ago #

    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.


Topic Closed

This topic has been closed to new replies.

About this Topic