Drupal 7 How to find Nodes, tagged with Broken Taxonomies? In Drupal 7, some Taxonomy Terms were deleted (by force from direct DB Query, for some reason). So some Nodes left remained by still tagging this deleted Taxo Terms. Then the problem is arising at the Site Indexing stage. The process is getting broken.

So i believe i need to find the Nodes which are tagging to these no longer existing/broken Taxonomy Terms, to un-tag those.


Which is the best way to do it?
What will be the best Query for it?


Thanks.
Just as an FYI, even if the terms had been deleted properly, the references still would have been broken (see Database records not deleted for Term Reference Fields after Term is Deleted).

Either way, to answer your question, you could use use super useful Taxonomy Orphanage module.


  This module provides interfaces (drush, cron, admin form) for removing
  orphaned taxonomy term references from entities.