register_term_meta()WP 4.9.8

Registers a meta key for terms.

1 time — 0.000001 sec (speed of light) | 50000 times — 0.26 sec (very fast) | PHP 7.1.11, WP 4.9.8

No Hooks.


true|false. True if the meta key was successfully registered, false if not.


register_term_meta( $taxonomy, $meta_key, $args );
$taxonomy(string) (required)
Taxonomy to register a meta key for. Pass an empty string to register the meta key across all existing taxonomies.
$meta_key(string) (required)
The meta key to register.
$args(array) (required)
Data used to describe the meta key when registered. See register_meta() for a list of supported arguments.


Since 4.9.8 Introduced.

Code of register_term_meta() WP 5.9.3

function register_term_meta( $taxonomy, $meta_key, array $args ) {
	$args['object_subtype'] = $taxonomy;

	return register_meta( 'term', $meta_key, $args );