Created
December 5, 2012 02:16
-
-
Save wokamoto/4211532 to your computer and use it in GitHub Desktop.
[WordPress] revision とか auto-draft とか trash な post を全部削除する SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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