Created
November 11, 2013 15:22
-
-
Save judge/7414829 to your computer and use it in GitHub Desktop.
recount wordpress taxonomies
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 tt1 | |
SET count = | |
(SELECT count(p.ID) FROM wp_term_relationships tr | |
LEFT JOIN wp_posts p | |
ON (p.ID = tr.object_id AND ( p.post_type = 'post' OR p.post_type = 'interview' ) AND p.post_status = 'publish') | |
WHERE tr.term_taxonomy_id = tt1.term_taxonomy_id) | |
WHERE tt1.taxonomy = 'post_tag' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment