WordPress For Dummies
Book image
Explore Book Buy On Amazon

Many new WordPress users are intimidated by the MySQL database. But WordPress bloggers don’t ever have to dig into the database unless they want to. You only need to explore the database if you’re dealing with theme or plugin development, or with contributing code to the WordPress project. However, this basic overview of the WordPress database stored in MySQL looks at the structure so you know where your WordPress data is stored.

After WordPress is installed on your server, the database gets populated with 11 tables that exist to store different types of data from your WordPress blog:

  • wp_commentmeta: This table stores every comment published to your site contains information, or metadata, that includes a unique comment ID number and a comment meta key, meta value, and meta ID (unique numerical identifiers assigned to each comment left by you, or visitors, on your site)

  • wp_comments: This table stores the body of the comments published to your site, including

    • A post ID that specifies which post the comment belongs to.

    • The comment content.

    • The comment author’s name, URL, IP address, and e-mail address.

    • The comment date (day, month, year, and time).

    • The comment status (approved, unapproved, or spam).

  • wp_links: This stores the name, URL, and description of all Links you create by using the WordPress Link Manager. It also stores all the advanced options for the links you created, if any.

  • wp_options: This stores all the option settings that you set for WordPress after you install it, including all theme and plugin option settings.

  • wp_postmeta: This includes all posts or pages published to your site and contains metadata that includes

    • The unique post ID number. (Each blog post has a unique ID number to set it apart from the others.)

    • The post meta key, meta value (unique numerical identifiers for each post created on your site), and any custom fields you’ve created for the post.

  • wp_posts: This table features the body of any post or page you’ve published to your blog, including autosaved revisions and post option settings, such as

    • The post author, date, and time.

    • The post title, content, and excerpt.

    • The post status (published, draft, or private).

    • The post comment status (open or closed).

    • The post type (page, post, or custom post type).

    • The post comment count.

  • wp_terms: This stores the categories you’ve created for posts and links as well as tags that have been created for your posts.

  • wp_term_relationships: This stores the relationships among the posts as well as the categories and tags that have been assigned to them.

  • wp_term_taxonomies: WordPress has three types of taxonomies by default: category, link, and tag. This table stores the taxonomy associated for the terms stored in the wp_terms table.

  • wp_usermeta: This table features metadata from every user with an account on your WordPress web site. This metadata includes

    • A unique user ID.

    • A user meta key, meta value, and meta ID, which are unique identifiers for users on your site.

  • wp_users: The list of users with an account on your WordPress web site is maintained within this table and includes

    • The username, first name, last name, and nickname.

    • The user login.

    • The user password.

    • The user e-mail.

    • The registration date.

    • The user status and role (subscriber, contributor, author, editor, or administrator).

Most web hosting providers give you a utility, or an interface, to view your MySQL database, and the most common one is phpMyAdmin. If you’re unsure how you can view your database on your hosting account, get in touch with your hosting provider to find out.

About This Article

This article can be found in the category: