apply_filters( ‘wp_insert_term_duplicate_term_check’, object $duplicate_term, string $term, string $taxonomy, array $args, int $tt_id )

In this article

Filters the duplicate term check that takes place during term creation.


Term parent + taxonomy + slug combinations are meant to be unique, and wp_insert_term() performs a last-minute confirmation of this uniqueness before allowing a new term to be created. Plugins with different uniqueness requirements may use this filter to bypass or modify the duplicate-term check.


Duplicate term row from terms table, if found.
Term being inserted.
Taxonomy name.
Arguments passed to wp_insert_term() .
More Arguments from wp_insert_term( … $args )Array or query string of arguments for inserting a term.
  • alias_of string
    Slug of the term to make this term an alias of.
    Default empty string. Accepts a term slug.
  • description string
    The term description. Default empty string.
  • parent int
    The id of the parent term. Default 0.
  • slug string
    The term slug to use. Default empty string.
term_taxonomy_id for the newly created term.


$duplicate_term = apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id );



User Contributed Notes

You must log in before being able to contribute a note or feedback.