The Node has attached two terms.

enter image description here

Term::load($node->get('field_posts_category')->target_id); only returns first item. How to get all Taxonomy Term attached to Node?

1 Answer 1


Use the method referencedEntities() to get all terms:

$terms = $node->field_posts_category->referencedEntities();

Your Answer

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

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