Created
February 12, 2018 13:39
-
-
Save Soben/d2c24e176be1df0eef649f9fb42671da to your computer and use it in GitHub Desktop.
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
UPDATE wp_term_taxonomy SET count = ( | |
SELECT COUNT(*) FROM wp_term_relationships rel | |
LEFT JOIN wp_posts po ON (po.ID = rel.object_id) | |
WHERE | |
rel.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id | |
AND | |
wp_term_taxonomy.taxonomy NOT IN ('link_category') | |
AND | |
po.post_status IN ('publish', 'future') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment