• I’m sort of surprised that, as far as I can tell, WordPress does not seem to have a function that will gracefully delete tags. I’m writing a plugin that is specifically tailored to finding orphaned or irrelevant tags in your blog and deletes them, but I’m not seeing this function which I assumed would naturally be there.

    So, here’s the question: is there a function that I’m missing that will delete tags? And if not, is simply deleting the term from the database acceptable? Seems to me that you’d want to delete the relationship between the tag and the posts it was assigned to, for tidiness’ sake, but I haven’t seen any negatives to just pulling out the term.

    Thanks for your help!

    [moderated–bump removed. Please refrain from bumping as per Forum Rules]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The Tag Management Page– Posts->Tags– seems pretty graceful to me, but it would be nice if you could order by ‘Posts’. That would give you your ‘orphaned’ tags. The ‘get_terms()’ function support an ‘orderby’ arg but I’m not sure if you can pass one to it without hacking ‘tag_rows()’ which looks to be missing a kinda useful parameter. Finding ‘irrelevant’ tags might be a trick.

    But to delete tags, I think the function you are looking for is ‘wp_delete_term()’. Look in wp-includes/taxonomy.php.

    Must be a consensus here as Austin suggested the same thing on the wp-hackers list:

    https://comox.textdrive.com/pipermail/wp-hackers/2009-February/024972.html

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Writing a Plugin that Deletes Tags’ is closed to new replies.