Title: get_taxonomy_labels
Published: April 25, 2014
Last modified: May 20, 2026

---

# get_taxonomy_labels( WP_Taxonomy $tax ): object

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#wp--skip-link--target)

Builds an object with all taxonomy labels out of a taxonomy object.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#parameters)󠁿

 `$tax`[WP_Taxonomy](https://developer.wordpress.org/reference/classes/wp_taxonomy/)
required

Taxonomy object.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#return)󠁿

 object Taxonomy labels object. The first default value is for non-hierarchical 
taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).

 * `name` string
 * General name for the taxonomy, usually plural. The same as and overridden by `
   $tax->label`. Default `'Tags'`/`'Categories'`.
 * `singular_name` string
 * Name for one object of this taxonomy. Default `'Tag'`/`'Category'`.
 * `search_items` string
 * Default ‘Search Tags`'/'`Search Categories’.
 * `popular_items` string
 * This label is only used for non-hierarchical taxonomies.
    Default ‘Popular Tags’.
 * `all_items` string
 * Default ‘All Tags`'/'`All Categories’.
 * `parent_item` string
 * This label is only used for hierarchical taxonomies. Default ‘Parent Category’.
 * `parent_item_colon` string
 * The same as `parent_item`, but with colon `:` in the end.
 * `name_field_description` string
 * Description for the Name field on Edit Tags screen.
    Default ‘The name is how
   it appears on your site’.
 * `slug_field_description` string
 * Description for the Slug field on Edit Tags screen.
    Default ‘The “slug” is the
   URL-friendly version of the name. It is usually all lowercase and contains only
   letters, numbers, and hyphens’.
 * `parent_field_description` string
 * Description for the Parent field on Edit Tags screen.
    Default ‘Assign a parent
   term to create a hierarchy. The term Jazz, for example, would be the parent of
   Bebop and Big Band’.
 * `desc_field_description` string
 * Description for the Description field on Edit Tags screen.
    Default ‘The description
   is not prominent by default; however, some themes may show it’.
 * `edit_item` string
 * Default ‘Edit Tag`'/'`Edit Category’.
 * `view_item` string
 * Default ‘View Tag`'/'`View Category’.
 * `update_item` string
 * Default ‘Update Tag`'/'`Update Category’.
 * `add_new_item` string
 * Default ‘Add Tag`'/'`Add Category’.
 * `new_item_name` string
 * Default ‘New Tag Name`'/'`New Category Name’.
 * `template_name` string
 * Default ‘Tag Archives`'/'`Category Archives’.
 * `separate_items_with_commas` string
 * This label is only used for non-hierarchical taxonomies. Default ‘Separate tags
   with commas’, used in the meta box.
 * `add_or_remove_items` string
 * This label is only used for non-hierarchical taxonomies. Default ‘Add or remove
   tags’, used in the meta box when JavaScript is disabled.
 * `choose_from_most_used` string
 * This label is only used on non-hierarchical taxonomies. Default ‘Choose from 
   the most used tags’, used in the meta box.
 * `not_found` string
 * Default ‘No tags found`'/'`No categories found’, used in the meta box and taxonomy
   list table.
 * `no_terms` string
 * Default ‘No tags`'/'`No categories’, used in the posts and media list tables.
 * `filter_by_item` string
 * This label is only used for hierarchical taxonomies. Default ‘Filter by category’,
   used in the posts list table.
 * `items_list_navigation` string
 * Label for the table pagination hidden heading.
 * `items_list` string
 * Label for the table hidden heading.
 * `most_used` string
 * Title for the Most Used tab. Default ‘Most Used’.
 * `back_to_items` string
 * Label displayed after a term has been updated.
 * `item_link` string
 * Used in the block editor. Title for a navigation link block variation.
    Default‘
   Tag Link`'/'`Category Link’.
 * `item_link_description` string
 * Used in the block editor. Description for a navigation link block variation. 
   Default ‘A link to a tag`'/'`A link to a category’.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#source)󠁿

    ```php
    function get_taxonomy_labels( $tax ) {
    	$tax->labels = (array) $tax->labels;

    	if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) ) {
    		$tax->labels['separate_items_with_commas'] = $tax->helps;
    	}

    	if ( isset( $tax->no_tagcloud ) && empty( $tax->labels['not_found'] ) ) {
    		$tax->labels['not_found'] = $tax->no_tagcloud;
    	}

    	$nohier_vs_hier_defaults = WP_Taxonomy::get_default_labels();

    	$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];

    	$labels = _get_custom_object_labels( $tax, $nohier_vs_hier_defaults );

    	if ( ! isset( $tax->labels->template_name ) && isset( $labels->singular_name ) ) {
    		/* translators: %s: Taxonomy name. */
    		$labels->template_name = sprintf( _x( '%s Archives', 'taxonomy template name' ), $labels->singular_name );
    	}

    	$taxonomy = $tax->name;

    	$default_labels = clone $labels;

    	/**
    	 * Filters the labels of a specific taxonomy.
    	 *
    	 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
    	 *
    	 * Possible hook names include:
    	 *
    	 *  - `taxonomy_labels_category`
    	 *  - `taxonomy_labels_post_tag`
    	 *
    	 * @since 4.4.0
    	 *
    	 * @see get_taxonomy_labels() for the full list of taxonomy labels.
    	 *
    	 * @param object $labels Object with labels for the taxonomy as member variables.
    	 */
    	$labels = apply_filters( "taxonomy_labels_{$taxonomy}", $labels );

    	// Ensure that the filtered labels contain all required default values.
    	$labels = (object) array_merge( (array) $default_labels, (array) $labels );

    	return $labels;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/taxonomy.php#L707)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/taxonomy.php#L707-L755)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#hooks)󠁿

 [apply_filters( “taxonomy_labels_{$taxonomy}”, object $labels )](https://developer.wordpress.org/reference/hooks/taxonomy_labels_taxonomy/)

Filters the labels of a specific taxonomy.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Taxonomy::get_default_labels()](https://developer.wordpress.org/reference/classes/wp_taxonomy/get_default_labels/)`wp-includes/class-wp-taxonomy.php` |

Returns the default labels for taxonomies.

  | 
| [_get_custom_object_labels()](https://developer.wordpress.org/reference/functions/_get_custom_object_labels/)`wp-includes/post.php` |

Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#)

| Used by | Description | 
| [WP_Taxonomy::set_props()](https://developer.wordpress.org/reference/classes/wp_taxonomy/set_props/)`wp-includes/class-wp-taxonomy.php` |

Sets taxonomy properties.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.6.0](https://developer.wordpress.org/reference/since/6.6.0/) | Added the `template_name` label. | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Added the `name_field_description`, `slug_field_description`, `parent_field_description`, and `desc_field_description` labels. | 
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Added the `item_link` and `item_link_description` labels. | 
| [5.7.0](https://developer.wordpress.org/reference/since/5.7.0/) | Added the `filter_by_item` label. | 
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `most_used` and `back_to_items` labels. | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added the `items_list_navigation` and `items_list` labels. | 
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Added the `no_terms` label. | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

[Show 3 more](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#)

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/?output_format=md#comment-content-3775)
 2.   [crstauf](https://profiles.wordpress.org/crstauf/)  [  6 years ago  ](https://developer.wordpress.org/reference/functions/get_taxonomy_labels/#comment-3775)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_taxonomy_labels%2F%23comment-3775)
    Vote results for this note: 3[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_taxonomy_labels%2F%23comment-3775)
 4. The return object also includes a `menu_name` property (defaults to `name` property),
    which is used for the tab in the admin menu.
 5.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_taxonomy_labels%2F%3Freplytocom%3D3775%23feedback-editor-3775)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_taxonomy_labels%2F)
before being able to contribute a note or feedback.