Skip to content

Instantly share code, notes, and snippets.

@kosinix
Created February 8, 2015 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kosinix/271fda85fca497aea314 to your computer and use it in GitHub Desktop.
Save kosinix/271fda85fca497aea314 to your computer and use it in GitHub Desktop.
Delete WP Post revisions
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment