Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Wordpress database structure and table description

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Data table structure:

Wp_commentmeta: storing metadata for comments

Wp_comments: storing comments

Wp_links: store links (Blogroll)

Wp_options: storing WordPress system options and plug-ins, theme configuration

Wp_postmeta: stores metadata for articles (including pages, uploaded files, revisions)

Wp_posts: store articles (including pages, uploaded files, revisions)

Wp_terms: stores each directory, label

Wp_term_relationships: stores the relationship between each article, link, and corresponding category

Wp_term_taxonomy: stores the categories corresponding to each directory and label

Wp_usermeta: stores the user's metadata

Wp_users: storing users

They are roughly divided into five categories according to their functions:

User: user information, including the wp_ users table and the wp_ users table.

Link: link information, including the wp_ links table.

Post: article and comment information, including wp_posts, wp_postmeta, wp_comments.

Category,link_category,tag: this is a complex information module that includes the management of categories, link classifications, tags, including wp_term,wp_term_relationships and wp_term_ taxonomy tables.

Option: global settings information, including the wp_ options table.

Wp_posts

As a blog system, the core is of course some "articles" published by bloggers, these "articles" are stored in this wp_posts table. Note that the "article" here is in quotation marks, because this table contains not only ordinary articles, but also some information about attachments and pages (page). The post_type field in the table is used to indicate the type. It is also important to note that some of the fields in this table are specific to the specific type of post_type, such as menu_order, which is specific to "page" and is used to specify the order of "pages". Post_mime_type specifies the type of attachment for attachments.

Wp_postmeta

The attributes of each article cannot be fully marked by only the fields in the wp_posts table, but often vary from person to person: mood, location, and so on when writing this article. The names and value types of these attributes are uncertain, so Wordpress uses meta-information (meta) to represent them. This table is very simple, only meta_id, post_id, meta_key, meta_value these four fields. Post_id is the id of the related post. We note that meta_value is of type longtext, which is only used to store values. As for the exact type of value, programmers need to care about it.

When writing the article, we can find that there is an option for Custom Fields under the edit box, where we can add the meta information of post.

Wp_comments

User comments. In addition to the content of the comments, the user's name, mailbox, URL, browser type and other information are also recorded. The two more important fields are comment_post_ID and comment_approved, the former used to indicate which article the comment belongs to, and the latter to record the audit status. Another interesting thing is the commnet_agent field, which we can use to count the user's browser type.

Wp_users

User account table. Stores user names, passwords, and some basic information about the user.

Wp_usermeta

Similar to the wp_postmeta above, it stores user information that varies from person to person. (such as QQ? ICQ? )

Wp_options

Used to record some of the settings and options for WordPress. There is a blog_id field, which should be used in the MU version to mark different Blog.

Wp_links

Used to store links in Blogroll.

Wp_terms, wp_term_relationships, wp_term_taxonomy

These three tables are the most complex of these. They were not available in WordPress 2.2 and previous versions, and are replaced by wp_categories, wp_post2cat, and wp_link2cat. Comparing the two versions, we can see that in version 2.2 and previous versions, the relationship between post and link and category is recorded through separate tables. With the addition of tag support in version 2.3, Wordpress abstracts the classification of post, link and tag into a unified form and uses three new tables to record this information.

Wp_terms

Record classification, link classification, some brief information about tags, including names and abbreviations.

Wp_term_taxonomy

It is a supplement of relational information to the information in wp_terms, category,link_category,tag, detailed description, parent class, number of articles (links) owned.

Wp_term_relationships

Relational tables, many-to-many, object_id is associated with different objects, such as ID in wp_posts (link_id in wp_links), etc. Term_taxonomy_id is the term_taxonomy_id in the associated wp_term_taxonomy.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report