WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How To Delete All Unused Page Revisons?

[Resolved] How To Delete All Unused Page Revisons?

  • Dan Poynor
    Member

    @danpoynor

    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.

    Thanks
    DAN

Viewing 4 replies - 1 through 4 (of 4 total)
  • moshu
    Member

    @moshu

    The search works, and I found this:
    http://exper.3drecursions.com/2008/07/25/disable-revisions-and-autosave-plugin/

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

    Marcelo Pedra
    Participant

    @kent-brockman

    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.

    DAN

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