delete_term_meta()WP 4.4.0

Removes metadata matching criteria from a term.

No Hooks.

Return

true|false. True on success, false on failure.

Usage

delete_term_meta( $term_id, $meta_key, $meta_value );
$term_id(int) (required)
Term ID.
$meta_key(string) (required)
Metadata name.
$meta_value(mixed)
Metadata value. If provided, rows will only be removed that match the value. Must be serializable if non-scalar.
Default: ''

Examples

0

#1 Delete the test_meta_field meta-field of taxonomy element 62

$deleted = delete_term_meta( 62, 'test_meta_field' );

echo $deleted ? 'OK' : 'BAD';

Changelog

Since 4.4.0 Introduced.

delete_term_meta() code WP 6.5.2

function delete_term_meta( $term_id, $meta_key, $meta_value = '' ) {
	return delete_metadata( 'term', $term_id, $meta_key, $meta_value );
}