WordPress Database Structure and Schema
A database will be created whenever you install a WordPress site. Everything on your WordPress website will be stored in this database.
WordPress website by default contains 12 tables.
WordPress database table relationship
All content related to the WordPress website is stored in this table. Such as navigation menu, images, media files, and all attachments.
All plugins data is also stored in this table. This table also contains the text revisions and custom items.
Data about data is called metadata.
wp_postmeta is extension of
wp_posts. Some plugin data may also store in this table. Basically, it stores extra information from
wp_options is the most important table of WordPress websites. It contains all administrative settings.
This table contains the website URL, titles, installed plugin & many more. The settings of plugins stores in this table also.
This table also stored the WordPress dashboard settings.
wp_options the table doesn’t share the relationship with other tables.
All registered user information stores in this table. Such as like username, password, email, display name, and registration time of the users.
wp_usermeta is the extension of
wp_users. This table store the extra information of the
wp_terms contain the categories for posts and pages. It also contains the tag(slugs) for the posts. Links related to categories are also stores in this table. This table has a relationship with
wp_term_taxonomy stores the description of categories, tags, and certain links associated with categories.
wp_term_relationships helps to maintain relationships. The
wp_posts contains the post data. The wp_term_relationships table records the set category and tags.
wp_links contain the information about custom links added to your WordPress site. It has been deprecated and is not used any longer. Few older plugins still use. But usually, it is an empty table.
All comments (Approved and Unapproved) are stored in this table. This table also stores the information like author name, email, type of comment(whether it’s a simple comment and pingback/trackback).
Extra information about the comments like which posts and pages are associated with stored here.
wp_termmeta was introduced in WordPress 4.4. This table used to store additional info about terms. It is possible to access the term meta using the following function: