• I am looking at wp_term_taxonomy table.
    There is term_taxonomy_id column.
    There is term_id column.
    The values are exactly the same for each record.
    So what exactly is the difference between them?

Viewing 3 replies - 1 through 3 (of 3 total)
  • https://codex.www.ads-software.com/WordPress_Taxonomy#wp_term_taxonomy

    As I understand it, the term_tanoxonmy_id is like a key which make the link between a taxonomy and a term. A term_id is the vertiable id of the term in its table.

    It enable to separate terms which have the same ID but are not registered in the same taxonomy (e.g. if you have a term ‘humour’ twice, one in ‘category’ and the other in ‘tags’).

    • This reply was modified 7 years, 7 months ago by Nokaa.
    Thread Starter Andrei Zhitkov

    (@abtop)

    I see. wp_term_taxonomy is a joint table to resolve multiple-to-multiple relations, right?
    https://codex.www.ads-software.com/images/2/25/WP4.4.2-ERD.pngnull

    Moderator bcworkz

    (@bcworkz)

    Not quite, I’d say it’s one to many, but it depends what you are relating to what. One term relates to many term relationships through term taxonomy but one term relationship does not relate to many terms through term taxonomy. To be many to many, one row in either table can relate to many rows in the other. I can see no single term relationship that would relate to multiple terms, can you?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘term_taxonomy_id vs term_id’ is closed to new replies.