Created
April 13, 2016 16:19
-
-
Save jprieton/f1ba40284cc3fc814c16ff91dadc3c99 to your computer and use it in GitHub Desktop.
Delete all products in woocommerce with comments
This file contains hidden or 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_type in ('product', 'product_variation', 'shop_order'); | |
delete from wp_postmeta where post_id not in (select ID as post_id from wp_posts); | |
delete from wp_comments where comment_post_ID not in (select ID as comment_post_ID from wp_posts); | |
delete from wp_commentmeta where comment_id not in (select comment_ID as comment_id from wp_comments); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment