How to delete old obsolete terms after node's term field has been updated? Because the old version of the term is left in the vocabulary and not deleted or updated with the new term.

So what I mean is that vocabulary should contain only terms that exist on at least one node.

I need this because I'm using certain vocabulary on Views as exposed filter and old terms leftovers messes it up.
A better description of what you're looking for is "orphaned terms". There exists a module that addresses that use case, called Delete Orphaned Terms.


  This is a utility module for deleting "orphaned" taxonomy terms. By
  default, terms with zero nodes associated with them are considered
  orphans, though administrators can specify the number of nodes
  associated with a term in order for it to be considered an orphan.