Support » Plugins » Hacks » Tags saved in database

  • Resolved willx



    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    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.

    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…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Tags saved in database’ is closed to new replies.