Created
October 12, 2022 02:53
-
-
Save tuongpgjz/2c02093bc073ab81d0b021d14f6623ba to your computer and use it in GitHub Desktop.
Correct product count on categories WooCommerce - 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
-- Run this SQL commands from PhpMyAdmin or similar ways | |
-- change the wp_ to your tables prefix to make it works | |
-- Script from SalesGen.io | |
UPDATE wp_term_taxonomy tt SET count = (SELECT COUNT(object_id) FROM wp_term_relationships WHERE term_taxonomy_id = tt.term_taxonomy_id) WHERE taxonomy = 'product_cat'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment