Skip to content

Instantly share code, notes, and snippets.

@fedek6
Created May 14, 2021 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedek6/36393aa5c33d21eb049fe7b0059b5718 to your computer and use it in GitHub Desktop.
Save fedek6/36393aa5c33d21eb049fe7b0059b5718 to your computer and use it in GitHub Desktop.
Export WP tags
SELECT wp_terms.`term_id` AS TagID, wp_terms.`name` AS TagName, SUM( tax.`count` ) AS TagPostCount
FROM `wp_terms`
INNER JOIN wp_term_taxonomy tax ON tax.term_id = wp_terms.term_id
GROUP BY wp_terms.`term_id`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment