taxonomy_select_nodes returns all the nodes tagged with a given tid. This function checks the taxonomy_index table. That table stores the tid and the nids on which it is tagged.

Let's say I have some custom entities with terms on them AND a user entity with terms on it, how do I get all the entities tagged with a given tid? Can this be done in 1 query/function?

1 Answer 1


I'm afraid not. The taxonomy index table is maintained specifically for nodes. There is no equivalent for other entities. It would be possible to maintain an index of your own though.

A workaround would be reusing the same field on different fieldable entities. Then you would only need to query the data field table to get all referenced entities.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.