Get rid of unused post revisions

/ Published in: MySQL
Save to your folder(s)

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.

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.