What Is the WordPress Database Format? Tables and Structure (2026)
Every post, page, user and setting on your site lives in a database. Most site owners never look inside it. Then a move, a backup or an error forces the question: what format is this thing in? The short answer is that WordPress uses a MySQL or MariaDB database made of tables. The longer answer is more useful. This guide shows how the data is laid out, which tables matter, and what format you get when you export it. It is written for 2026 and for current versions of WordPress.
What Format Does the WordPress Database Use?
WordPress stores its data in a relational database. That means the data sits in tables, a bit like a set of linked spreadsheets. Each table has columns for the type of data and rows for each record. WordPress talks to the database in SQL, which is the standard language for this kind of system. Two database systems are supported: MySQL and MariaDB. They are close cousins, and WordPress treats them the same way.
The database is not a single file in your site folder. It runs as a service on the server, apart from your themes, plugins and uploads. Your files and your data are two halves of one site. You need both to restore it. In 2026, the official advice is MySQL 8.0 or newer, or MariaDB 10.6 or newer. Older versions may still run, but they no longer get security fixes. You can see which system your site uses under Tools → Site Health → Info → Database. That screen shows the server version, the database name and the table prefix. If you want the full story on database engines, read our guide on whether WordPress uses MySQL or PostgreSQL.
The 12 Core Tables in a Standard WordPress Database
A fresh single-site install creates twelve tables. Each one has a clear job. The names below use the default wp_ prefix, though your site may use a different one. Plugins often add their own tables on top, so a busy site can have fifty or more. The core twelve stay the same on every install.
- wp_posts holds posts, pages, menu items, media records and revisions.
- wp_postmeta holds extra fields tied to each post, such as a page template or a product price.
- wp_options holds site settings, such as the site URL, active plugins and theme choices.
- wp_users holds each account: login name, email and a hashed password.
- wp_usermeta holds extra user details, such as roles and profile choices.
- wp_terms holds the names of categories, tags and other terms.
- wp_term_taxonomy says what kind of term each one is, such as a category or a tag.
- wp_term_relationships links posts to their terms.
- wp_termmeta holds extra fields for terms.
- wp_comments holds comments, pingbacks and trackbacks.
- wp_commentmeta holds extra fields for comments.
- wp_links is a leftover from the old blogroll feature. It still exists but sits empty on most sites.
Notice the pattern. Four main objects exist: posts, users, terms and comments. Each one has a main table and a matching “meta” table for extra data. Once you see that, the rest of the layout is easy to follow.
How WordPress Stores Posts, Pages and Custom Fields
The wp_posts table does far more than its name hints. A blog post is a row in it. So is a page, an image record, a menu item and each saved revision. A column named post_type tells them apart. It holds values such as post, page, attachment and revision. Custom post types, such as products or events, are rows in this same table with their own type name. This is why a site with 200 pages can show 3,000 rows here.
The body of each post sits in the post_content column as HTML text. The block editor adds short HTML comments around each block, such as <!-- wp:paragraph -->. These mark where one block ends and the next begins. Nothing is stored as a design file. It is all plain text. The post_status column records the state, such as publish, draft or trash. Dates are saved twice, once in the site’s time zone and once in GMT.
Extra fields go in wp_postmeta. Each row is a simple pair: a key name and a value, tied to a post ID. One post can have many rows. A featured image, for example, is saved as a key named _thumbnail_id. If you need to pull this data out, our guide on how to retrieve data from a WordPress database walks through it.
Storage Engine, Character Set and Collation Explained
Three technical settings shape the format of each table. You rarely need to change them, but you should know what they mean. They come up during moves between servers, and a mismatch can cause import errors or odd symbols in your text.
Storage engine. This is the part of the database system that writes rows to disk. Modern WordPress tables use InnoDB. It locks only the row being changed, so many visitors can read and write at once. It can also recover cleanly after a crash. Very old sites may still have tables on MyISAM, an older engine that locks the whole table on each write. If you find MyISAM tables, ask your host about a move to InnoDB, and take a backup first.
Character set. This decides which letters and symbols a table can hold. WordPress has used utf8mb4 by default since version 4.2. It covers every language plus emoji. Older sites may still use plain utf8, which cannot store four-byte symbols.
Collation. This is the rule set for sorting and comparing text. New installs most often use utf8mb4_unicode_520_ci. The ci at the end means case does not matter in a search. An older server may not know this collation. That is a common cause of an “unknown collation” error when you import a database on a new host.
What the Table Prefix Is and Where It Is Set
Every WordPress table name starts with a prefix. The default is wp_, which gives you names like wp_posts. The prefix lets more than one site share a single database. One site can use wp_ and a second can use shop_, and their tables never clash. Some site owners also pick a custom prefix at setup, so the table names are harder to guess.
The prefix is set in a file named wp-config.php. It sits in the main folder of your site, next to wp-load.php. Open it and look for the line that begins with $table_prefix. The same file holds the four values WordPress needs to reach the database: DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. It also holds DB_CHARSET, which is utf8mb4 on current installs.
A word of care is needed here. Do not change the prefix on a live site by editing this one line. The table names in the database would no longer match, and the site would act like a fresh install. Some rows inside wp_options and wp_usermeta also carry the prefix in their key names. A prefix change means a rename of every table plus those rows. Always take a full backup first, and test the change on a staging copy before you touch the live site.
Serialized Data: The Format Inside the Format
Some values are too complex for one plain cell. A widget setup or a list of active plugins is a whole set of values, not one. WordPress packs these into a single text string with a PHP method named serialization. The result looks odd at first sight. A short example is a:1:{s:5:"color";s:4:"blue";}. Here, a:1 means an array with one item. The s:5 means a string that is five characters long.
You find serialized data mostly in wp_options, wp_postmeta and wp_usermeta. The format matters because of those length counts. Say you run a find and replace in the raw database to swap an old domain for a new one. If the new domain is longer, the count no longer matches the text. WordPress then fails to read the value, and the setting comes back empty. Widgets vanish and theme options reset.
The safe route is a tool that understands the format. WP-CLI, the command line tool for WordPress, has a wp search-replace command. It unpacks each value, makes the swap, and packs it again with the right counts. Take a database backup before you run it, and try it on a staging copy first. Add the --dry-run flag to see what would change before anything is written.
What Format Is a WordPress Database Export?
When you export the database, you get a file that ends in .sql. It is a plain text file. Inside is a long list of SQL commands. Some create each table. Others insert each row. To restore the site, a database server reads the file from top to bottom and rebuilds the tables. Because it is text, it shrinks well. Many tools save it as .sql.gz or .zip to cut the size.
There are three common ways to make this file. Most hosts offer phpMyAdmin in their control panel. Pick your database, open the Export tab, and keep the format set to SQL. With command line access, wp db export backup.sql does the same job through WP-CLI. A backup plugin can also do it on a schedule. Our guide on how to back up your WordPress database covers each route step by step. To learn the control panel tool, see what phpMyAdmin is used for in WordPress.
Do not mix this up with Tools → Export in the dashboard. That screen makes an XML file, known as WXR. It holds posts, pages, comments and terms. It does not hold settings, users’ passwords, plugin data or widgets. It is a content export, not a database backup. For a full copy of the site, you need the .sql file plus the wp-content folder.
How Multisite and WooCommerce Change the Structure
The twelve-table layout is only the starting point. Two common setups add to it in ways that surprise people. It helps to know them before you open a database and find more than you expected.
Multisite. A multisite network runs many sites from one install. It adds network-wide tables, such as wp_blogs, wp_site, wp_sitemeta and wp_signups. Each extra site then gets its own set of content tables with a number in the name. The second site uses wp_2_posts and wp_2_options, the third uses wp_3_posts, and so on. Users are shared. All sites read from the same wp_users and wp_usermeta tables.
WooCommerce. A store adds its own tables for orders, tax rates, shipping zones and product lookups. Older stores kept each order as a row in wp_posts. Current versions use High-Performance Order Storage, which keeps orders in tables such as wp_wc_orders and wp_wc_order_addresses. You can check which mode a store uses under WooCommerce → Settings → Advanced → Features. This matters if you write custom reports, because the order data may not be where an older guide says it is.
Other plugins. Form, SEO, security and cache plugins often create tables too. Some leave them behind after you remove the plugin. These orphan tables do no harm, but they add to the size of every backup.
Keeping Your WordPress Database in Good Shape
A tidy database is easier to back up, move and fix. You do not need to be a developer to look after it. A few simple habits cover most of the work, and each one ties back to the format described above.
First, keep a recent .sql backup stored away from the server. Check that it opens and has a sensible size. Second, look at Tools → Site Health every few weeks. It flags an out-of-date database server and other issues. Third, watch the wp_options table. Rows marked to autoload are read on every page view, so a bloated table can slow the whole site. Fourth, limit post revisions, since each one is a full row in wp_posts. Our guide on how to optimize database performance in WordPress explains each clean-up task. If tables report errors, see how to repair a database in WordPress.
Direct edits to the database carry real risk, since there is no undo button. If you would like a second pair of eyes before a move, a prefix change or a clean-up, the team at 24×7 WP Support works on WordPress databases every day. Reach out any time, and we can take a look at what your site needs.
Related posts:

WordPress vs HTML: Which Is Better for Your Website?

How to Maximise Direct Hotel Bookings with WordPress UX Design

How to Add Internal Links in WordPress: A Complete 2026 Guide

Free SEO Options for WordPress: What Actually Works in 2026

How to Limit WordPress Registration to Specific Email Domains in 2026

Brian is a WordPress support specialist and content contributor at 24×7 WP Support. He writes practical, easy-to-follow guides on WordPress troubleshooting, WooCommerce issues, plugin and theme errors, website security, migrations, performance optimization, and integrations. With a focus on solving real website problems, Brian helps business owners, bloggers, and online store managers keep their WordPress sites running smoothly.


