Data table structure:
Wp_commentmeta: Storing meta-data for comments
Wp_comments: Store Comments
Wp_links: Store links (blogroll)
Wp_options: Store wordpress system options and plugins, theme configuration
Wp_postmeta: Storing metadata for articles (including pages, uploading files, revisions)
Wp_posts: Storing articles (including pages, uploading files, revisions)
Wp_terms: Store each directory, label
Wp_term_relationships: Storing relationships for each article, link, and corresponding category
Wp_term_taxonomy: Store the category for each directory and label
Wp_usermeta: Storing the user's meta data
Wp_users: Storing Users
The features are broadly categorized into five categories:
User information, including wp_users tables and Wp_usermeta tables.
Link: links to information, including wp_links tables.
Post: Articles and commentary information, including Wp_posts, Wp_postmeta, wp_comments.
Category,link_category,tag: This is a more complex information module, it contains the classification, link classification, label management, including Wp_term,wp_term_relationships and wp_term_taxonomy table.
Option: Global settings information, including the Wp_options table.
Wp_posts
As a blog system, the core of course is the blogger published a number of "articles", these "articles" stored in the place is the Wp_posts table. Note that the word "article" here is quoted, because the table contains some information about attachments and pages (page) in addition to ordinary articles. 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 post_type, such as Menu_order, which is specific to the page, which specifies the order of the pages. The Post_mime_type is for attachments, specifying the type of attachment.
Wp_postmeta
The properties of each article is not possible to simply use the wp_posts table of the few fields completely marked, often also have some characteristics of the individual: write this article when the mood, location and so on. The names and value types of these properties are indeterminate, 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 relevant post. We note that Meta_value is a longtext type, which is used only to store values, and for the exact type of value, the programmer needs to be concerned.
In writing, we can find an option for the Custom field below the edit box, where we can add the meta information for post.
Wp_comments
User reviews. In addition to the content of the comments, it also records the comments of the user's name, email, URL, browser type and other information. The more important two fields are comment_post_id and comment_approved, the previous one to indicate which article the comment belongs to, and the latter to record the status of the review. Another interesting thing is this commnet_agent field, which we can use to count the user's browser type.
Wp_users
User Account table. The user name, password, and some basic information about the user are stored.
Wp_usermeta
Similar to the above Wp_postmeta, store some user information for different users. (such as QQ?) Icq? )
Wp_options
Used to record some of WordPress's settings and options. There is a blog_id field, this should be used in the MU version to mark the different blog.
Wp_links
Used to store links inside the blogroll.
Wp_terms, Wp_term_relationships, wp_term_taxonomy
These three tables are the most complex of the relationship, in WordPress 2.2 and previous versions of the three tables are not, the generation is wp_categories, Wp_post2cat and wp_link2cat these three tables. Comparing these two versions, we can see that the relationship between post and link and category is recorded by separate tables in version 2.2 and previous versions. In the 2.3 version of the added tag support, Wordpress, post, link, tag classification are abstracted into a unified form, with a new three tables to record this information.
Wp_terms
Record categories, link categories, and tags for some brief information, including names, abbreviations.
Wp_term_taxonomy
is the information supplement to the information in Wp_terms, with the number of the owning type (CATEGORY,LINK_CATEGORY,TAG), detailed description, parent class, and the amount of articles (links).
Wp_term_relationships
Relational tables, many-to-many, object_id are associated with different objects, such as the ID in wp_posts (link_id in wp_links), term_taxonomy_id is wp_term_taxonomy in the associated term_ taxonomy_id.
WordPress database structure and table description