Using Views Bulk Operation to delete orphan taxonomy terms (Terms that have no nodes associated with them)

Deleting orphan terms especially in a free tagging vocabulary is reasonably common task for site administrators. Orphan terms in this case means taxonomy terms that are not used by any nodes (content pieces). I had to look up various issue queues for this and found this in the issue queue of the term node count module. If interested here is the link to the page #603868: Rework Term Node Count for D7
Steps to get this working:

  1. Create a new view. Name it anything you want.
  2. Display: choose taxonomy term. If you want to delete orphan tags from a particular vocabulary, choose the vocabulary. Add the page title etc and click create and edit to move to the next page
  3. In the section Relationships choose "Taxonomy Term: Content with Term" from the list of options. Leave the default identifier "node" or choose a descriptive label if you wish.
  4. In the Fields section add Content: nid and Bulk Operations: Taxonomy Term. Label the Content: nid field with a descriptive label such as "node count". For the Bulk Operation field type in label as "select" . Ensure enable select all items and display processing result are checked . In the selected operation choose the delete operation. Check the delete without confirmation if you want to delete the terms without an intermediate confirmatory dialog page.
Subscribe with RSS Subscribe to RSS - Terms