Skip to content

Instantly share code, notes, and snippets.

@jb510
Last active May 5, 2024 22:16
Show Gist options
  • Save jb510/30dd61ad8d25476907dcb164ba4a1e24 to your computer and use it in GitHub Desktop.
Save jb510/30dd61ad8d25476907dcb164ba4a1e24 to your computer and use it in GitHub Desktop.
Delete WordPress tags MySQL
DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE count = 0 );
DELETE FROM wp_term_taxonomy WHERE term_id not IN (SELECT term_id FROM wp_terms);
DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment