Last active
June 23, 2022 09:48
-
-
Save tuongpgjz/b2453c4cb1e6b61e80e580c823304ea4 to your computer and use it in GitHub Desktop.
Remove WooCommerce products by category name or a part of category name
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
-- replace category_name by your category name | |
DELETE FROM wp_posts WHERE ID IN (SELECT object_id from wp_term_relationships WHERE term_taxonomy_id IN(SELECT term_taxonomy_id FROM `wp_term_taxonomy` WHERE taxonomy = 'product_cat' AND term_id IN (SELECT term_id FROM `wp_terms` WHERE name like '%category_name%'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment