Last active
January 7, 2025 17:52
-
-
Save carmolim/dfcef98d5542ba40524388dfa16c89f5 to your computer and use it in GitHub Desktop.
Deletar todos os produtos do woocommerce via SQL
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 relations.*, taxes.*, terms.* | |
FROM wp_term_relationships AS relations | |
INNER JOIN wp_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product'); | |
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product'); | |
DELETE FROM wp_posts WHERE post_type = 'product'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Olá @carmolim você tem algum código para excluir todos os pedidos do Woocommerce pelo SQL assim como esse de excluir produtos?