• Michael Torbert

    (@hallsofmontezuma)


    WordPress Virtuoso

    In wp_term_taxonomy table, why are term_taxonomy_id and term_id not the same?

    The term_id column is the same as the term_id column in the wp_terms table.
    The term_taxonomy_id column is the same as the term_taxonomy_id column in wp_term_relationships.

    Usually they are the same number, but sometimes they’re different. What is the purpose of not using the same number for both?

    I rewrote the admin->manage/edit->post code from scratch to use fewer sql queries (I have a blog that has 5500 categories and the WordPress code makes it time out) and not realizing there was a distinction between the two database columns made it stressful and took longer to complete.

    Does anyone know the reason for two different ones, which then requires you to go from one to the other depending on what you’re doing?

  • The topic ‘In wp_term_taxonomy table, why are term_taxonomy_id and term_id not the same?’ is closed to new replies.