Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Created November 14, 2014 02:54
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 wokamoto/13535867e1e7d5332c7d to your computer and use it in GitHub Desktop.
Save wokamoto/13535867e1e7d5332c7d to your computer and use it in GitHub Desktop.
[WordPress] pending の記事を全削除する SQL
delete from wp_posts where post_type = 'post' and post_status = 'pending';
delete from wp_postmeta where not exists (select 'x' from wp_posts where wp_posts.ID = wp_postmeta.post_id);
delete from wp_term_relationships where not exists (select 'x' from wp_posts where wp_posts.ID = wp_term_relationships.object_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment