"Turn" WordPress database and the structure analysis of each table

Source: Internet
Author: User
Tags unique id wordpress database

The default WordPress has the following 11 tables altogether. The default table prefix, WP_, is added here.

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

In the WordPress database structure, storage system options and plug-in configuration of the Wp_options table is a relatively independent structure, in the following article will be mentioned, it uses the Key-value mode storage, the benefits are easy to expand, each plug-in can be easily stored here

To store your own configuration.

Post,comment,user is a combination of three basic tables plus an expansion table. Take Wp_users as an example, Wp_users has stored the basic information each user will use, such as login_name, display_name, password, email and other commonly used information, but if

We also want to store some infrequently used data, the best way is not to add a column after the table, to destroy the default table structure, but the data exists in Wp_usermeta. Wp_usermeta This extension table and Wp_options table have a similar structure that we can save here

Store each user's QQ number, mobile phone number, login wordpress backstage Theme options and so on.

More difficult to understand is the term, namely Wp_terms, Wp_term_relationships, wp_term_taxonomy. In the WordPress system, our common classification an article, the classification of links, in fact, tag, it is also a special classification method,

We can even create our own classification methods. WordPress will all the classification and classification methods, corresponding structure are recorded in these three tables. Wp_terms records the name of each category and basic information, such as this site is divided into "WordPress development", "Wpceo plugin

"And so on, the classification here refers to a generalized classification, so each tag is also a" classification. " Wp_term_taxonomy records the classification method belonging to each classification, such as "WordPress development", "Wpceo plugin" is the article Classification (category), placed friendship chain

The "My Friends" and "my colleagues" category belong to the link classification (link_category). Wp_term_relationships records each article (or link) corresponding to the classification method.

Fortunately, the use of the term, WordPress, the use of related functions is relatively clear, we do not have to struggle with its structure.

In the above we have described the role of each table in the WordPress database, this article will continue to describe the role of each column in each table. WordPress Official documents already have a more detailed table, this article only the common data to introduce.

Wp_commentmeta
meta_id: self-increment unique ID
COMMENT_ID: corresponding Comment ID
Meta_key: Key Name
Meta_value: Key value


Wp_comments
comment_id: Self-increment unique ID
COMMENT_POST_ID: Corresponding article ID
Comment_author: Reviewer
Comment_author_email: Reviewer Email
Comment_author_url: Reviewer URL
COMMENT_AUTHOR_IP: Reviewer IP
Comment_date: Comment Time
COMMENT_DATE_GMT: Comment Time (gmt+0 time)
Comment_content: Comment Text
Comment_karma: Unknown
Comment_approved: Whether the comment was approved
Comment_agent: Reviewer's user agent
Comment_type: Comment Type (pingback/normal)
Comment_parent: Parent Comment ID
USER_ID: Reviewer User id (not necessarily present)


Wp_links
link_id: self-increment unique ID
Link_url: Link URL
Link_name: Link title
Link_image: Link Picture
Link_target: Link Open mode
Link_description: Link Description
Link_visible: Visible (y/n)
Link_owner: Add-on User ID
Link_rating: Rating Rating
Link_updated: Unknown
LINK_REL:XFN relationship
LINK_NOTES:XFN notes
Link_rss: Link RSS Address


Wp_options
option_id: self-increment unique ID
BLOG_ID: Blog ID, for multi-user blogs, default 0
Option_name: Key Name
Option_value: Key value
AutoLoad: Automatically load when WordPress is loaded (yes/no)


Wp_postmeta
meta_id: self-increment unique ID
POST_ID: corresponding article ID
Meta_key: Key Name
Meta_value: Key value


Wp_posts
ID: self-increment unique ID
Post_author: corresponding Author ID
Post_date: Release Time
POST_DATE_GMT: Release Time (gmt+0 time)
Post_content: Body
Post_title: Title
POST_EXCERPT: Excerpt
Post_status: Article Status (Publish/auto-draft/inherit, etc.)
Comment_status: Comment Status (open/closed)
Ping_status:ping status (open/closed)
Post_password: Article password
Post_name: Article thumbnail name
To_ping: Unknown
Pinged: A link that has been ping
Post_modified: Modification Time
POST_MODIFIED_GMT: Modification Time (gmt+0 time)
Post_content_filtered: Unknown
Post_parent: Parent article, primarily for page
GUID: Unknown
Menu_order: Sort ID
Post_type: Article type (post/page, etc.)
Post_mime_type:mime type
Comment_count: Total number of reviews


Wp_terms
TERM_ID: Category ID
Name: Category name
Slug: Abbreviated name
Term_group: Unknown


Wp_term_relationships
OBJECT_ID: Corresponding article id/link ID.
TERM_TAXONOMY_ID: Corresponding classification Method ID
Term_order: Sort


Wp_term_taxonomy
TERM_TAXONOMY_ID: Classification Method ID
Term_id:taxonomy: Classification Method (Category/post_tag)
Description: Unknown
Parent: The owner of the classification method ID
Count: Number of articles statistics


Wp_usermeta
umeta_id: self-increment unique ID
USER_ID: corresponding User ID
Meta_key: Key Name
Meta_value: Key value


Wp_users
ID: self-increment unique ID
User_login: Login Name
User_pass: Password
User_nicename: Nickname
User_email:email
User_url: URL
User_registered: Registration Time
User_activation_key: Activation Code
User_status: User Status
display_name: Display name

 

< Span style= "font-size:18px" > < Span style= "font-size:18px" > < Span style= "font-size:18px" >

"Go" WordPress database and table structure analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.