Explainers · Explainer
What Is the WordPress Database? A Plain Explanation

Short answer
The WordPress database is the MySQL or MariaDB database where WordPress stores almost everything on your site: posts, pages, comments, users, and settings. A standard install creates 12 tables, all sharing a prefix that is wp_ by default. Theme files, plugin files, and uploaded images live in folders on the server, not in the database.
Key takeaways
- WordPress stores posts, pages, comments, users, and settings in a MySQL or MariaDB database.
- A standard single-site install creates 12 default tables, all sharing the wp_ prefix.
- The wp_posts table holds posts, pages, attachments, revisions, and menus, one row per item.
- The wp_options table stores site settings as key-value pairs, including the site URL and active plugins.
- WordPress connects to the database using the details stored in wp-config.php.
- Backups must include both the database and the files, since images live in folders, not tables.
What is the WordPress database?
The WordPress database is the MySQL or MariaDB database where WordPress stores almost everything on your site.
Your posts, pages, comments, users, and settings all live there, while your theme files, plugin files, and uploaded images live in folders on the server.
WordPress reads from the database on every page load and writes to it whenever you publish, edit, or change a setting. Without it, WordPress shows an error instead of your site.
Learn WordPress, the official WordPress training site, puts it plainly: WordPress uses a database to store, retrieve, and display all the content you create on your website, including posts, pages, and comments (The WordPress Database).
The same tutorial notes that the database also stores information about your users and the site options that run your site.
What database software does WordPress use?
WordPress runs on MySQL or MariaDB, two closely related open-source database systems.
WordPress.org's requirements page, checked November 2026, recommends PHP 8.3 or greater and MariaDB 10.11 or greater, or MySQL 8.4 or greater (Requirements).
The same page notes that WordPress also works with PHP 7.4 and MySQL 5.5.5 or newer in older setups, but warns those versions have reached end of life and may expose your site to security risks.
Most hosts give you one or the other, and you rarely need to pick. If your host offers a choice, MySQL vs MariaDB for WordPress explains how they differ in practice.
What does the WordPress database store?
The database stores your content, your users, your settings, and the links between them.
Posts and pages are the largest part, but the database also holds comments, categories and tags, menus, widgets, plugin settings, theme settings, and scheduled tasks. Media files themselves are not stored in the database.
An image file sits in the uploads folder, while the database holds a record of it, with its title, file path, and alt text, in the posts table.
That split is why a backup must include both parts. A database backup alone will not restore your images, and a files backup alone will not restore your posts. Our guide to cPanel backup vs plugin backup compares ways to cover both.
What are the 12 default WordPress tables?
A standard single-site WordPress install creates 12 tables, all sharing one prefix.
The WordPress Codex database description lists 12 tables created during a standard installation (Database Description). Every table name starts with the same prefix, which is wp_ by default. You can change the prefix during installation, and the choice is stored in wp-config.php.
| Table | What it stores |
|---|---|
wp_posts | Posts, pages, attachments, revisions, menus, custom post types |
wp_postmeta | Extra fields for posts, pages, and attachments |
wp_comments | Comments left on posts and pages |
wp_commentmeta | Extra fields for comments |
wp_users | User accounts, login names, email addresses, password hashes |
wp_usermeta | Extra fields for users, such as profile settings |
wp_terms | Category and tag names |
wp_term_taxonomy | Whether each term is a category, a tag, or another taxonomy |
wp_term_relationships | Links between posts and their terms |
wp_termmeta | Extra fields for terms |
wp_options | Site settings, active plugins, active theme |
wp_links | Old Links feature data, kept for backward compatibility |
Plugins, themes, and WooCommerce can add more tables of their own. A site with several plugins often has 30 or more tables, and that is normal.
What is the wp_posts table?
The wp_posts table holds the core content of your site, with one row for each post, page, or attachment.
Learn WordPress calls wp_posts probably the most important table in a WordPress site, and notes that each row represents a single post (The WordPress Database). Pages, navigation menu items, and revisions are stored there too, using the same table with a different post type value.
The table stores the title, content, date, status, author, and type for each item. Drafts, scheduled posts, and trashed posts all sit in wp_posts with a status value that tells WordPress whether to show them.
Deleting a post from the trash removes its row, which is why a post deleted that way cannot be recovered without a backup.
What is the wp_postmeta table?
The wp_postmeta table stores extra details about posts, pages, and attachments that do not fit in wp_posts.
Each row links a post ID to a key and a value, a pattern called a meta field or custom field. Featured image IDs, SEO titles, page builder layouts, and product prices are common examples.
Learn WordPress notes that post meta is often called custom fields, and that plugins add their own information to this table (The WordPress Database).
Because meta rows are tied to a post ID, deleting a post should also remove its meta rows. Orphaned meta rows left behind by a removed plugin are a common cause of database bloat, and they are one reason a site can slow down as it grows.
What is the wp_options table?
The wp_options table stores your site settings as key-value pairs, one row per setting.
Learn WordPress explains that the siteurl option stores your site URL, the blogdescription option stores your tagline, and the table also stores your active theme and active plugins (The WordPress Database). The list of active plugins is stored as serialized data, which is a single string that packs several values together.
Some options are marked as autoloaded, which means WordPress loads them into memory on every page. A small number of autoloaded rows is fine, but plugins that pile large values into autoloaded options can slow every page on the site.
If your dashboard feels slow, an oversized wp_options table is worth checking, as explained in our guide to fixing a slow admin dashboard.
What do the users and comments tables hold?
The wp_users and wp_usermeta tables hold accounts, while wp_comments and wp_commentmeta hold comments.
Each row in wp_users is one user account, with the login name, email address, and a password hash, not the plain password. Learn WordPress notes that each row in the wp_users table represents a single user, and wp_usermeta holds extra details about that user (The WordPress Database).
The comments tables work the same way. Each row in wp_comments is one comment, and wp_commentmeta holds extra fields for it. Spam comments pile up in these tables, so clearing spam and trash regularly keeps the database smaller.
How does WordPress connect to the database?
WordPress connects using the details stored in wp-config.php, a file in your site root.
The WordPress developer handbook says wp-config.php contains your website's base configuration details, such as database connection information (Editing wp-config.php). WordPress reads that file on every page load that is not served from cache, then opens a connection to the database named there.
If the connection details are wrong, or the database server is down, visitors see the message “Error establishing a database connection.” That error has several causes, from wrong login details to a crashed database server, and our guide to what causes “Error establishing a database connection” walks through them in order.
How do you look at your WordPress database?
Most hosts provide phpMyAdmin, a web tool that lets you browse tables and run queries in your browser.
Learn WordPress notes that most local development environments and hosting companies use phpMyAdmin, a free web-based tool for working with your database (The WordPress Database). The same tutorial names Adminer as an alternative, a single PHP file you upload to your site that gives a similar interface.
You can view tables, search rows, and export a backup from phpMyAdmin. Editing rows directly is possible, but it is risky, because one wrong edit can break links between tables. Always export a backup first, and prefer the WordPress dashboard or a plugin for routine changes.
What mistakes should you avoid?
The most common database mistakes are editing rows by hand, skipping backups, and letting tables grow unchecked.
Never edit the database directly on a live site without a backup you have already tested. A single changed value in wp_options, such as the site URL, can lock you out of the dashboard. If that happens, our guide to fixing “Error establishing a database connection” covers the checks to run first.
Do not delete tables that belong to a plugin you still use, and do not delete the wp_links table just because it looks unused. It is kept for backward compatibility, and removing core tables can break updates.
When you remove a plugin, use its own cleanup option if it has one, then check that its tables are gone before you move on.
Frequently asked questions
Where is the WordPress database stored?
It runs on your hosting server as a MySQL or MariaDB database, separate from your WordPress files. Your host usually gives you access through phpMyAdmin or a similar tool in the hosting panel. WordPress connects to it on every page load using the details in wp-config.php.
Can I delete tables added by a plugin I removed?
Yes, but only after you are sure the plugin is gone and you have a backup. Some plugins leave their tables behind when deleted, and removing them by hand is safe once the plugin is inactive. Never delete the 12 core tables, and never delete a table on a live site without an export first.
Does the WordPress database store my images?
No. Image files live in the wp-content/uploads folder on your server. The database only stores a record of each image, with its title, file path, and alt text, in the wp_posts table. That is why a full backup must include both the database and the files.
How many tables does a normal WordPress site have?
A standard single-site install starts with 12 tables. Plugins, themes, and WooCommerce add more, so a site with several plugins often has 30 or more tables. Multisite installs add a set of tables for each site in the network, sharing the users and usermeta tables.
What happens if the WordPress database is deleted?
Your site stops working and shows an error establishing a database connection. All posts, pages, users, comments, and settings are gone unless you have a backup. Your theme and plugin files and uploaded images would still be on the server, but WordPress cannot use them without the database.
Sources
- The WordPress Database Learn WordPress
- Database Description WordPress Codex
- Requirements WordPress.org
- Editing wp-config.php WordPress Developer Resources
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


