Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WordPress] revision とか auto-draft とか trash な post を全部削除する SQL
delete from wp_posts
where post_status in ('auto-draft', 'trash')
or post_type = 'revision';
delete from wp_postmeta
where not exists (select 'x' from wp_posts where wp_posts.ID = wp_postmeta.post_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.