Loop through taxonomy parents How can i loop through taxonomy in drupal 8.
I found this static function but TID is required, how can i loop through all taxonomy without using TID?

Drupal::entityManager()-&gt;getStorage('taxonomy_term')-&gt;loadAllParents($tid);
I think you are using the word "parent" incorrectly.

The terms of a vocabulary can be sorted in a tree. And the parents of a specific term are the ones higher in that hierachy. So, if you want all parents of a term, of course you need so say, which term and give its id as $tid.

However, if you just want all terms of a taxonomy, you can use loadTree($vid) instead. $vid is the id of your vocabulary.

If you want to load all taxonomy terms, ignoring which vocabulary they belong to, then this is the best solution:

$terms = \Drupal::entityTypeManager()-&gt;getStorage('taxonomy_term')-&gt;loadMultiple();


Then, to access the term data do

foreach ($terms as $term) {
    $tid = $term-&gt;id();
    $vid = $term-&gt;getVocabularyId();
    $name = $term-&gt;getName();
}


If all you need is the ids of all the terms, this is enough:

$tids = \Drupal::entityQuery('taxonomy_term')-&gt;execute();