update_term_meta ( $term_id, $meta_key, $meta_value, $prev_value = '' )

  • (int) $term_id Term ID.
  • (string) $meta_key Metadata key.
  • (mixed) $meta_value Metadata value.
  • (mixed) $prev_value Optional. Previous value to check before removing.
  • (int|WP_Error|bool) Meta ID if the key didn't previously exist. True on successful update. WP_Error when term_id is ambiguous between taxonomies. False on failure.
Defined at:


Updates term metadata.

Use the $prev_value parameter to differentiate between meta fields with the same key and term ID.

If the meta field for the term does not exist, it will be added.

Related Functions

update_site_meta, update_user_meta, update_usermeta, update_termmeta_cache, update_meta

Top Google Results

User discussions

wpseek mobile