WordPress

How Many Tables in a Default WordPress?

A default WordPress install has 12 database tables; multisite starts at 18 and adds 10 per site. How to count yours and why plugins push it higher.

Shashank Dubey
·12 min read
A default WordPress install has 12 database tables, shown as a grid of table names; multisite starts at 18 and adds 10 per extra site

A default single-site WordPress install creates 12 database tables. That was true on 18 November 2026 for WordPress 7.1.4, the current release, and it has been 12 since WordPress 4.4 added the term meta table in 2015. A multisite network starts with 18 tables and adds 10 more for every extra site. Anything beyond those numbers in your database came from a plugin, a theme, another install sharing the same database, or leftovers from software you removed.

We checked every number in this guide two ways. First we read the table lists in the WordPress 7.1.4 source code (the wpdb class and wp-admin/includes/schema.php). Then we ran a throwaway WordPress 7.1.4 install with WP-CLI 2.12.0 on PHP 8.5.5, counted the tables, converted a copy to multisite, added two popular plugins and deleted them again. The results are below, with the commands so you can repeat them on your own site.

If you want to know what each of the 12 tables stores and how to clean them, our guide to the different types of WordPress default tables covers that table by table. This article stays on the count: what the right number is, how to check yours, and what it means when your number is different.

The short answer

  • Single site: 12 tables. 10 hold site content and settings, 2 hold users.
  • Multisite: 18 tables for the main site, then 10 per additional site. A network with 5 sites has 18 + (4 x 10) = 58 core tables.
  • Your prefix does not change the count. wp_ is only the default. With abc_ you still get 12 tables, named abc_posts, abc_options and so on.
  • Plugins add tables and usually leave them behind. On our test site, WooCommerce and Yoast SEO took the count from 12 to 54, and deleting both plugins left all 54 in place.
  • A missing core table breaks the site. With the options table gone, our test site returned “Error establishing a database connection” with an HTTP 500.

How many tables does a default WordPress install have?

Twelve. The list lives in two properties of the wpdb class in WordPress core: $tables holds the 10 per-site tables and $global_tables holds the 2 user tables. The installer creates exactly these, using the CREATE TABLE statements in wp_get_db_schema(). Here they are with the default prefix, grouped by job.

Group

Tables

What lives there

Content

wp_posts, wp_postmeta

Posts, pages, attachments, menus, revisions, block templates, and their custom fields

Taxonomy

wp_terms, wp_term_taxonomy, wp_term_relationships, wp_termmeta

Categories, tags and custom taxonomies, and which post belongs to which term

Comments

wp_comments, wp_commentmeta

Comments, pingbacks and their extra data

Settings

wp_options

Site settings, plugin settings, transients and cron

Users

wp_users, wp_usermeta

Accounts, roles and per-user settings

Links

wp_links

The old blogroll, still created on every install

That is 2 + 4 + 2 + 1 + 2 + 1 = 12. On our test install, wp db tables printed exactly these 12 names and nothing else.

# checked on 18 Nov 2026: WordPress 7.1.4, WP-CLI 2.12.0
$ wp db tables
wp_commentmeta
wp_comments
wp_links
wp_options
wp_postmeta
wp_posts
wp_term_relationships
wp_term_taxonomy
wp_termmeta
wp_terms
wp_usermeta
wp_users

Media files are a common surprise here. WordPress has no separate images table: each upload is a row in the posts table with the type attachment, and its sizes and dimensions sit in post meta. Our batch sibling on where image data is stored in the WordPress database walks through exactly which rows to look at.

Why is the number 12, and has it always been 12?

No. The count has moved a few times, and that history explains why some old databases look odd. We took the version numbers from the @since notes in the 7.1.4 source and from the upgrade routines in wp-admin/includes/upgrade.php.

WordPress version

What changed

Single-site count after

2.3 (2007)

The terms system arrived: three term tables were added, and the upgrade dropped the old categories, post2cat and link2cat tables

10

2.9 (2009)

Comment meta table added

11

3.0 (2010)

Multisite merged into core with its own network tables (single sites unchanged)

11

3.5 (2012)

Link Manager hidden for new installs, but the links table is still created

11

4.4 (2015)

Term meta table added

12

5.1 (2019)

Site meta table added, for multisite networks only

12

So a guide written before WordPress 4.4 (December 2015) that says “11 tables” was right at the time, and one from before 2.9 that says 10 was right too. In the 7.1.4 source, no single-site table carries a version newer than 4.4.

The links table is the odd one. WordPress hid the Link Manager screen for new sites in 3.5, and the 3.5 upgrade only kept it switched on for sites that already had links. The table itself is still part of the schema and is still created on every fresh install, so it counts. Our test site, which had never had a link, still had it.

The old category tables are also still known to core. $wpdb->tables( 'old' ) returns categories, post2cat and link2cat, which lets tools recognise them if they ever turn up in an ancient database. A fresh install never creates them.

How many tables does WordPress multisite create?

A new network has 18 core tables: the 12 from a single site, plus 6 network tables. Each site you add gets its own set of 10 per-site tables with the site ID in the prefix, such as wp_2_posts. The two user tables are shared by the whole network, so they are never copied per site.

Table

Scope

Purpose

wp_blogs

Network

One row per site: domain, path, status

wp_blogmeta

Network

Extra data per site (added in 5.1)

wp_site

Network

The network itself

wp_sitemeta

Network

Network-wide settings

wp_signups

Network

Pending user and site registrations

wp_registration_log

Network

Which user registered which site

wp_2_*, wp_3_* ...

Per site

The same 10 per-site tables for each extra site

We tested the formula on a copy of our install. After wp core multisite-convert the database had 18 tables. After creating two more sites with wp site create it had 38, which is 18 + (2 x 10). Deleting one site from the network dropped its 10 tables and left 28.

# checked on 18 Nov 2026 on a test copy, never on a live site
$ wp core multisite-convert --title="Bench Network" --base=/
$ wp db tables --all-tables | grep -c ^wp_
18
$ wp site create --slug=second
$ wp site create --slug=third
$ wp db tables --all-tables | grep -c ^wp_
38
$ wp site delete 3 --yes
$ wp db tables --all-tables | grep -c ^wp_
28

The formula, then, is 18 + 10 x (number of sites - 1) for core alone. A network of 50 sites carries 508 core tables before a single plugin is active. That is normal and not a reason for alarm, but it is why multisite backups and migrations take longer than people expect.

One older table can also appear on networks that started before WordPress 6.1: wp_sitecategories, used by the retired global terms feature. Core now lists it as an old multisite table. A network created today does not have it.

How do I count the tables in my own database?

Pick the method that matches the access you have. All four give the same answer when your database holds one WordPress site with no plugins.

With WP-CLI

The wp db tables command lists the tables WordPress knows about. By default it shows only tables registered on $wpdb, which is exactly the core set. Two flags widen the view, and they are the ones that answer “why do I have so many tables”.

Command

What it lists

wp db tables

Core tables registered on $wpdb only

wp db tables --all-tables-with-prefix

Every table that starts with your prefix, including plugin tables

wp db tables --all-tables

Every table in the database, whatever the prefix

wp db tables --scope=blog

Only the 10 per-site tables

wp db tables --network

All tables across a multisite network

# checked on 18 Nov 2026, WP-CLI 2.12.0
# count core tables, then everything with your prefix
wp db tables | wc -l
wp db tables --all-tables-with-prefix | wc -l

A small catch we hit: the command’s built-in help example for --scope=blog shows 9 tables and leaves out the links table. On a real 7.1.4 site the command returns 10, links included. Trust the output, not the example.

With SQL

If you only have phpMyAdmin, Adminer or a MySQL prompt, ask the information_schema database. This counts every table in the database your site uses.

-- checked on 18 Nov 2026 against the MySQL 8.4 information_schema docs
SELECT COUNT(*) AS total_tables
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE();

-- only tables that start with the literal prefix wp_
SELECT TABLE_NAME
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE()
  AND TABLE_NAME LIKE 'wp\_%'
ORDER BY TABLE_NAME;

Note the backslash before the underscore. In SQL LIKE patterns an underscore matches any single character, so 'wp_%' also matches tables named wpx_options or wp2posts from another install in the same database. Escaping it as wp\_% matches only the real prefix. The information_schema.TABLES view is documented in the MySQL 8.4 reference manual. MariaDB has the same view.

Run the first query in the database that your wp-config.php file names in DB_NAME. Shared hosting accounts often hold several databases, and counting the wrong one is an easy way to get a confusing number.

In phpMyAdmin or your host’s panel

Click the database name in the left column. The structure view lists every table with its row count and size, and the total table count shows at the bottom of the list. Sort by name and the tables group by prefix, which makes plugin tables and second installs easy to spot.

From PHP

Inside WordPress, $wpdb->tables() returns the core table names with your prefix applied. The scopes are all, blog, global, ms_global and old. On our single site, count( $wpdb->tables( 'all' ) ) returned 12.

<?php
// checked on 18 Nov 2026, WordPress 7.1.4
global $wpdb;
$core   = $wpdb->tables( 'all' );               // 12 on a single site
$actual = $wpdb->get_col( 'SHOW TABLES' );       // everything in the database
$extra  = array_diff( $actual, array_values( $core ) );
error_log( 'Core: ' . count( $core ) . ', extra: ' . count( $extra ) );

The difference between the two lists is the set of tables that are not core. That is the list worth reading before you decide anything about cleanup.

Why does my database have more than 12 tables?

Almost always because of plugins. To show how fast the count grows, we added two of the most installed plugins on WordPress.org to our clean 12-table site: WooCommerce 11.3.0 and Yoast SEO 28.8. We activated both with WP-CLI and listed every table.

Source

Tables added

Name pattern

Action Scheduler (ships inside WooCommerce)

4

wp_actionscheduler_*

WooCommerce, newer tables

18

wp_wc_*

WooCommerce, older tables

14

wp_woocommerce_*

Yoast SEO

6

wp_yoast_*

WordPress core

12

the default set

Total

54

Two plugins took the database from 12 to 54 tables. The WooCommerce figure is what activation through WP-CLI created on our test site. WooCommerce’s own list of installed database tables also includes order tables such as wc_orders, which were not present yet on our command-line install, so a store that has been through setup and taken orders will often have more. Plugin table counts change between versions, so treat our numbers as a snapshot from 18 November 2026, not a constant.

The other common causes of a high count:

  • Two or more installs in one database. Shared hosts and one-click installers often put several sites in one database with different prefixes. Each brings its own 12 tables.
  • Old staging copies. Some staging tools clone your tables into the same database under a new prefix. Deleting the staging site in the tool usually removes them. Deleting it by hand usually does not.
  • Leftovers from removed plugins. See the next section.
  • Multisite. Every site adds 10 core tables, and many plugins add their own per site as well.

A high count is not a problem by itself. Empty tables cost almost nothing when the site runs. What does cost something is a few large tables that nobody uses, which slow backups, migrations and restores. If size is your concern, the list of WordPress database mistakes that crash sites is the better starting point than the count.

Do plugin tables go away when you delete the plugin?

Usually not, and our test confirms it. After counting 54 tables we ran three steps and counted again after each one.

Step on our test site

Table count after

Activate WooCommerce 11.3.0 and Yoast SEO 28.8

54

Deactivate both plugins

54

Uninstall and delete Yoast SEO with wp plugin uninstall

54 (all 6 Yoast tables remain)

Uninstall and delete WooCommerce the same way

54

Both results are by design, not bugs. Yoast SEO registers its uninstall hook with __return_false, which means delete runs no cleanup at all. WooCommerce’s uninstall.php only removes its data when the site owner has added the constant WC_REMOVE_ALL_DATA set to true in wp-config.php, a guard against someone losing a store’s orders by deleting the plugin from the admin. Both choices protect people who reinstall later. The side effect is that the database never shrinks back to 12 on its own.

Deactivation never removes tables. That is the split the WordPress plugin handbook recommends: deactivation is for temporary things like flushing rewrite rules, and data removal belongs in uninstall, if the plugin does it at all. If a plugin stopped running without you deactivating it, our guide on what to do when a plugin deactivated itself explains how to find the cause, and none of those causes touch its tables either.

How to remove leftover tables safely

  1. Take a full database backup and download it off the server.
  2. List tables that are not core, using the PHP snippet above or wp db tables --all-tables-with-prefix.
  3. Match each prefix to a plugin. The table name nearly always contains the plugin’s slug or company name. Search your wp-content/plugins folder for the table name if unsure.
  4. Confirm the plugin is gone from every site that uses this database, including staging copies.
  5. Check the plugin’s documentation for a supported cleanup option first, such as WooCommerce’s constant or a delete-data setting in the plugin itself.
  6. Only then drop the tables, one plugin at a time, and load the site and wp-admin after each.

Never drop a table whose owner you cannot name. On multisite, check that the table is not a per-site table for a site that still exists.

What happens if a default table is missing?

It depends on which table. We tested both ends on our throwaway install.

A missing options table takes the site down. We dropped wp_options and loaded the home page. WordPress returned HTTP 500 with the page title “Database Error” and the heading “Error establishing a database connection”. That message is misleading: the connection was fine, but core could not read the site URL. It reaches that point through is_blog_installed(), which notices that some core tables exist and others do not, then stops instead of offering a fresh install. On the front end it prints the short connection message. In wp-admin the same check prints the clearer “One or more database tables are unavailable”, so load /wp-admin/ when you need the real reason. If you see that error and your database credentials are correct, list your tables before anything else. Our guide to WordPress database connection, charset and repair settings covers the credential side.

A missing minor table is quieter. We dropped wp_links. The site kept working, and wp db tables showed 11.

Recreating it taught us something worth sharing. wp core update-db did nothing, because it only runs upgrades when the stored database version is older than the code, and ours matched (61833). Calling dbDelta() with the core schema did recreate it:

# checked on 18 Nov 2026 on a test copy
$ wp core update-db
Success: WordPress database already at latest db version 61833.
$ wp eval 'require_once ABSPATH . "wp-admin/includes/upgrade.php"; print_r( dbDelta( "all" ) );'
Array
(
    [wp_links] => Created table wp_links
)

The built-in repair page at /wp-admin/maint/repair.php (enabled with WP_ALLOW_REPAIR) runs CHECK TABLE, REPAIR TABLE and ANALYZE TABLE on the core tables. It fixes damaged tables. It does not recreate a dropped one, and the data in a dropped table is only coming back from a backup. Remove the constant again once you are done, because the repair page needs no login.

Does the table prefix change the count?

No. The prefix set in $table_prefix in wp-config.php only changes the names. Two cases do change which tables appear, and both are rare:

  • Custom user tables. The constants CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE point WordPress at user tables with another name, often so two installs can share logins. $wpdb->tables() then returns those names in place of the default ones.
  • Several installs in one database. Each prefix is a separate site with its own 12 tables. A prefix in wp-config.php that matches none of them makes WordPress offer a fresh install.

That last case is the most common way people meet the table count by accident. After a migration the site shows the installation screen, and the tables are all there, just under a different prefix than the config file says.

Common mistakes people report

These problems come up again and again in forums and the WordPress bug tracker. We checked each source on 18 November 2026.

  • Expecting delete to remove plugin tables. A wordpress.org user reported that uninstalling a plugin left many tables behind with no option to remove them, and Kinsta’s guide to uninstalling WordPress plugins describes a security plugin that left 24 tables. Our test with WooCommerce and Yoast SEO matched.
  • The installation screen after a migration. When the prefix in wp-config.php does not match the tables, WordPress thinks it is not installed. InMotion Hosting’s article on the repeating installation screen lists the prefix as a leading cause. Do not click through the installer, which creates a second set of tables.
  • A vanished options table read as a connection error. In this wordpress.org thread a site showed “Error establishing a database connection” because the options table was gone. We reproduced the same message by dropping that table.
  • Deleted multisite sites leaving plugin tables. Core drops the 10 per-site tables it knows about. Plugin tables stay unless the plugin adds them through the wpmu_drop_tables filter. Trac ticket 43162 tracks the problem. We created a test table for site 2, deleted the site, and the table stayed.
  • Matching tables with an unescaped LIKE pattern. An underscore is a wildcard, so wp_% or wp_1_% catch tables from other prefixes or other sites. A MySQL bug report about underscores in SHOW TABLES LIKE was closed as expected behaviour for exactly this reason. Escape the underscore before you count or drop anything by pattern.

Frequently asked questions

How many tables does WordPress create on install?

Twelve on a single site, checked on WordPress 7.1.4. Ten store content and settings, and two store users.

How many tables does a WordPress multisite have?

Eighteen for a new network, then ten more per extra site. A 10-site network has 108 core tables.

Is the wp_links table still used?

Core still creates it and it counts toward the 12. The Link Manager screen is hidden on sites created since WordPress 3.5, so most sites never write to it.

Can I delete wp_links to get down to 11 tables?

You can, and the site keeps working, but there is no real gain. An empty table costs next to nothing, and a future dbDelta() run or repair tool may simply recreate it.

Why does my site have 60 or more tables?

Plugins. WooCommerce and Yoast SEO alone took our test site from 12 to 54. Old staging copies and other installs in the same database add more.

Do I need to remove tables from deleted plugins?

No, unless they are large or you are tidying before a migration. Back up first and only drop tables you can match to a plugin you no longer use anywhere.

Does the table prefix affect performance or security?

Neither in a meaningful way. A custom prefix does not stop SQL injection. Prepared queries do.

How we tested this

All counts and outputs above came from a throwaway WordPress 7.1.4 install (database version 61833) run on 18 November 2026 with PHP 8.5.5, WP-CLI 2.12.0 and the WordPress SQLite Database Integration plugin 3.1.3, so the database was SQLite. The table list a fresh install creates comes from core PHP code and is the same on MySQL and MariaDB. The multisite numbers came from converting a separate copy with wp core multisite-convert. The plugin numbers came from WooCommerce 11.3.0 and Yoast SEO 28.8 downloaded from WordPress.org that day. The SQL queries were checked against the MySQL 8.4 documentation, not run on our SQLite install. Version history came from the @since notes and the upgrade routines in the 7.1.4 source.

Part of the Wbcom Designs family

The all-in-one WordPress community stack

Also ours: wbcomdesigns.comvapvarun.combrndle.com