Drupal taxonomy hide empty terms

Hide empty terms from menu

Go to the admin/structure/taxonomy

Find the vocabulary, chose ‘edit vocabulary’.

Then in the ‘Taxonomy menu’ section, expand ‘Options’. You will see a ‘Hide empty terms’ checkbox.

Tick it.

Done.

Hide empty terms in a taxonomy view

For hide empty terms in a taxonomy view, here is a solution:

The goal is to create a views that will list all terms of a certain vocabulary. I have tried a lot but actually its quite easy.

You have th create a new view for taxonomy terms – see screenshot:

The view will show all Terms to prevent empty terms of showing up you have to create a relationship. Click add relation ship, filter for terms and choose “Taxonomy term: Representative node“. Check the “require this relationship” and thats it.

Above Screenshot “Add Relationship”