Posted By

jessibird on 03/10/10


Tagged

wordpress


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

kevinbanet
jessibird


Get rid of unused post revisions


 / Published in: MySQL
 

URL: http://www.wprecipes.com/wordpress-tip-get-rid-of-unused-post-revisions

Just run the following query on your WordPress database, and all revisions (As well as meta associated with it) will be deleted from your database.

  1. DELETE a,b,c
  2. FROM wp_posts a
  3. WHERE a.post_type = 'revision'
  4. LEFT JOIN wp_term_relationships b
  5. ON (a.ID = b.object_id)
  6. LEFT JOIN wp_postmeta c ON (a.ID = c.post_id);

Report this snippet  

You need to login to post a comment.