WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Tags saved in database (3 posts)

  1. willx
    Member
    Posted 2 years ago #

    Hello...

    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:

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

    _term_taxonomy
    => 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, ...

    _term_relationships
    => 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
    Member
    Posted 2 years ago #

    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.

  3. willx
    Member
    Posted 2 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