[resolved] Tags saved in database (3 posts)

  1. willx
    Posted 3 years ago #


    Could anyone tell me how exactly tags are stored in the database?

    At the moment, I had the impression that this data was stored in 3 tables, but when I manually add rows to these tables (SQL queries), WordPress doesn't see the post has been tagged with anything, even though it really is correct in the database (in those 3 tables).

    What I thought:

    => Table where terms (tags & categories) are stored, based on a term_id

    => Table where term_id's are linked to a term_taxonomy_id (to combine terms and posts later on), where its stored whether it is a tag or a category, who the parent-category could be, ...

    => Table which stores the relationship of a term_taxonomy_id and an object_id (which is a post_id)

    But... If I manually add rows to these 3 tables, as said before, wordpress doesn't see posts actually are tagged...

    What am I missing?

  2. Johnb81
    Posted 3 years ago #


    Tags are a WordPress taxonomy. A tag is named in table <prefix>_terms. It is assigned to a taxonomy in table <prefix>_term_taxonomy. It is then associated with a post in the table <prefix>_term_relationships.

  3. willx
    Posted 3 years ago #

    Those are all the things I said I have, but when I manually add rows to those tables, it doesn't show up on the "edit post" page or on the actual website (it doesn't say 'tagged with...')

    Somehow, even when everything is correct in the database, it won't show as the tag is connected to the post...

Topic Closed

This topic has been closed to new replies.

About this Topic