Created
October 12, 2022 02:55
-
-
Save tuongpgjz/5dc426904e7e4d6fb78e3c99af91e554 to your computer and use it in GitHub Desktop.
Remove all empty categories in WooCommerce
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
-- Run this SQL commands from PhpMyAdmin or similar ways | |
-- change the wp_ to your tables prefix to make it works | |
-- Script from SalesGen.io | |
DELETE FROM wp_term_taxonomy WHERE taxonomy = 'product_cat' AND count = 0; | |
DELETE t FROM wp_terms t LEFT JOIN wp_term_taxonomy tt ON tt.term_id = t.term_id WHERE tt.term_id IS NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment