Why term_id is not indexed in wp_term_taxonomy table?

A single term can, theoretically, be present in multiple taxonomies (and have a different description in each). That’s where term_taxonomy_id comes into play, referencing a single term within a single taxonomy.

In practice, WP tries to avoid that, and will create a term with the same name and a -2 (iirc) suffix on the slug if a term with the same slug already exists in a different taxonomy.

Leave a Comment