How to get every custom taxonomy names and urls?

There’s a bit of a difference between Taxonomies and Terms.

  • Taxonomy refers to a collection. For example, Category is the Post Taxonomy and inside this taxonomy you can have many Terms which can be assigned to the post. For more information check out The Codex, it may explain the difference better.
  • Term also refers to a collection but a collection of similar items. In the example above we are using the Category and inside that we could have News where all our News Posts are collected and assigned to.

Based on your question I’m going to assume when you say “taxonomy” you really mean “Term in the Brand Taxonomy”. The easiest approach if you want a list of assigned brands is to use get_the_term_list().

get_the_term_list( $post_id, 'brands' );

The above will display all the brands of a specific post in a comma separated list.


If you want to grab all terms you could use get_terms():

$brand_arr = get_terms( array(
    'taxonomy'      => 'brands',
    'hide_empty'    => false,
) );

if( ! is_wp_error( $brand_arr ) ) {

    // Loop through array of values ( foreach )
    // $term->name will display the name
    // Use `get_term_link()` to generate the term URL

}