SQL code to bulk remove tag references
-
I’ve got a WordPress website that I’ve been running an auto tagger on for a while now, which has cause the database to grow to simply be too large and I need a little help cleaning it out.
What I’d like to do is first, reset the _term_taxonomy table to count most tags as having 0 counts.
UPDATE wp_term_taxonomy SET count = 0 WHERE count < 20;
Next (and here’s where I’m hoping there’s a better suggestion … I need to purge all contents of both the wp_term_relationships and wp_term_relationships table where the wp_term_taxonomy count value is 0.
I know I can do this by looping but this’ll cause serious server load issues, so is there a quick piece of SQL that anybody can recommend?
[moderated–bump removed. Please refrain from bumping as per Forum Rules]
- The topic ‘SQL code to bulk remove tag references’ is closed to new replies.