get_term_meta()WP 4.4.0

Retrieves metadata for a term.

1 time — 0.000125 sec (fast) | 50000 times — 0.20 sec (very fast) | PHP 7.1.2, WP 4.7.3

No Hooks.


Mixed. An array of values if $single is false. The value of the meta field if $single is true. False for an invalid $term_id (non-numeric, zero, or negative value). An empty string if a valid but non-existing term ID is passed.


get_term_meta( $term_id, $key, $single );
$term_id(int) (required)
Term ID.
The meta key to retrieve. By default, returns data for all keys.
Default: ''
Whether to return a single value. This parameter has no effect if $key is not specified.
Default: false


Since 4.4.0 Introduced.

Code of get_term_meta() WP 6.0

function get_term_meta( $term_id, $key = '', $single = false ) {
	return get_metadata( 'term', $term_id, $key, $single );