Severity: Critical · Fix time: 15–60 min · Skill level: Advanced
The Table ‘wp_xxx’ Doesn’t Exist error is a critical database error that appears when WordPress attempts to query a MySQL or MariaDB table that is not present in the database. WordPress depends on a set of core tables — wp_posts, wp_options, wp_users, wp_usermeta, and others — to function at all. When any of these tables are missing, WordPress returns a database error or blank site, and in severe cases triggers an Error Establishing a Database Connection.
This error is almost always caused by one of three scenarios: a botched site migration where tables didn’t import completely, a database restore from an incomplete backup, or accidental deletion of a table through phpMyAdmin or a plugin. Unlike configuration errors that a file edit can fix, a missing table requires either a database restore or manually recreating the table from a known-good schema.
Need a quick map of every WordPress error? See our 70+ WordPress Errors Guide → for a categorized reference of every common WordPress issue.
[Image: phpMyAdmin interface showing a WordPress database with a missing core table highlighted or absent from the table list]
How the Table Doesn’t Exist Error Works
WordPress stores virtually all of its dynamic content in a relational database. When a page loads, WordPress fires multiple database queries — checking wp_options for site configuration, querying wp_posts for content, joining wp_postmeta for custom fields. If any queried table is absent, MySQL returns ERROR 1146: Table 'database_name.wp_tablename' doesn't exist, and WordPress either displays a database error or shows a blank page.
The table prefix in the error message (e.g., wp_ vs. custom_ or site2_) is important diagnostic information. It tells you whether the missing table belongs to core WordPress or a plugin, and whether a prefix mismatch might be the actual cause rather than a genuinely missing table.
Common causes:
- Incomplete migration — The database export ran during active use or timed out on a shared host’s execution limit, producing a truncated SQL file where some tables were never exported
- Table prefix mismatch — The
wp-config.phpon the new server uses a different$table_prefixvalue than the one used during export; tables exist but with a different prefix - Backup restoration from an inconsistent backup — A backup taken while an automated process was writing to the database may be missing critical tables
- Accidental table deletion — A phpMyAdmin operation intended to delete test data dropped a production table
- Plugin failing to create its tables — A plugin that stores data in custom tables may fail to create them during activation due to insufficient database permissions
Check This First — 2-Minute Diagnostic
- Read the full error message — Write down the exact table name.
wp_postsmissing is a core WordPress problem;wp_woocommerce_order_itemsmissing is a WooCommerce issue that a plugin repair can often fix. - Check the table prefix — Open wp-config.php via SFTP and find the
$table_prefixvalue. Open phpMyAdmin and verify the tables in the database use that same prefix. A mismatch means the tables exist — just with the wrong name. - Count the tables in phpMyAdmin — A standard WordPress installation has 12 core tables. If you see only 3 or 4, the import was incomplete.
- Confirm database credentials are correct — A
wp-config.phppointing to the wrong database (a common copy-paste error during migrations) produces identical symptoms to missing tables. - Check the most recent migration or restore action — A migration or restore within the last 24 hours is almost certainly the cause.
Purpose & Benefits
1. Preventing This Error Starts With Pre-Migration Verification
A missing table error after a migration is preventable. Verifying your SQL export contains all expected tables takes five minutes and eliminates the most common cause. Most table-missing errors come from exports that timed out on shared hosting execution limits. Our WordPress maintenance plans include migration support that accounts for these edge cases.
2. Understanding Table Structure Enables Recovery Without a Backup
Without a recent backup, you can sometimes recreate a missing plugin table by deactivating and reactivating the plugin, triggering its table creation routine. For core WordPress tables, WordPress provides a database repair tool. Neither is as reliable as a clean restore, but both are available options.
3. Table Prefix Mismatches Are the Most Common False Positive
Many of these errors are actually table prefix mismatches — the tables exist but WordPress is looking for them under the wrong name. Checking the prefix takes 30 seconds and rules it out before you attempt a full database restore.
Examples
1. Migration Timeout Produces an Incomplete Export
A site owner migrates a large WordPress database using phpMyAdmin’s export on shared hosting. The PHP execution limit terminates the export halfway, delivering a partial SQL file. The import runs but only half the tables exist. WordPress loads but returns “Table ‘wp_posts’ doesn’t exist.”
Fix: use a migration plugin (Duplicator, All-in-One WP Migration) that handles large databases in chunks, or export via the command line:
# Export the full database without PHP timeout risk
mysqldump -u db_username -p database_name > wordpress_backup.sql
# Import to the new database
mysql -u db_username -p new_database_name < wordpress_backup.sql2. Table Prefix Mismatch After Copying wp-config.php
A developer copies a wp-config.php from development to production. The development config uses $table_prefix = 'dev_' while the production database uses wp_. Every WordPress query fails because it’s looking for dev_posts, dev_options, etc. — the tables named wp_posts are all present.
Fix: update wp-config.php to match the actual prefix in the database.
// In wp-config.php — must match the prefix used in the actual database tables
$table_prefix = 'wp_'; // Change to match your database table prefix3. Plugin Table Missing After Failed Activation
A form builder plugin stores submissions in wp_formplugin_entries. After a migration that exported only core WordPress tables, the plugin is active but the table doesn’t exist. Fix: deactivate and reactivate the plugin. Most well-written plugins recreate missing tables on activation.
-- Verify which tables exist in your WordPress database
SHOW TABLES LIKE 'wp_%';
-- If the plugin table is missing, deactivate and reactivate via wp-adminNote: reactivation recreates the table structure but not the data — existing submissions are lost unless the migration is redone with plugin tables included.
Common Mistakes to Avoid
- Attempting to manually recreate a missing core table without a schema reference — WordPress core tables have a specific structure that changes between versions. Recreating
wp_postswith incorrect column types produces new errors. Always restore from a backup rather than manually recreating core tables. - Running the WordPress repair tool when tables are missing — The built-in repair tool can fix corrupted tables but cannot create missing ones. Don’t spend time running it if a complete table is absent — go straight to backup restoration.
- Importing a backup over a partial database without clearing first — Importing a new backup over an existing partial database can produce inconsistent mixed data. Drop all existing tables before importing a clean backup.
- Ignoring the prefix check — Spending an hour on a restore when tables exist with a different prefix is one of the most common diagnostic mistakes. Check the prefix first.
Best Practices
1. Verify Export Completeness Before Any Migration
Before importing a database to a new server, open the .sql file in a text editor and verify it contains CREATE TABLE statements for all expected tables:
# Count CREATE TABLE statements — should be 12+ for WordPress core
grep -c "CREATE TABLE" your_backup.sqlIf the count is under 12, the export is incomplete. Re-export before importing.
2. Use WP_ALLOW_REPAIR for Corrupted Tables (Not Missing Ones)
WordPress has a built-in repair utility for corrupted — not missing — tables. Add define('WP_ALLOW_REPAIR', true); to wp-config.php, then visit https://yourdomain.com/wp-admin/maint/repair.php. Remove the constant immediately after — the repair page is publicly accessible while it’s active.
3. Maintain Regular Database Backups
The most reliable fix for a missing table is a clean restore. A backup taken within the last 24 hours means maximum data loss is one day of content changes. Our WordPress maintenance plans include daily automated database backups with off-server storage precisely because this class of error has no good fix without them.
Frequently Asked Questions
What causes the “table doesn’t exist” error most often?
An incomplete database export — where the SQL dump timed out on shared hosting — is the most common cause. Second most common is a table prefix mismatch between wp-config.php and the actual database. The mismatch looks identical but is faster to fix: update $table_prefix in wp-config.php to match the actual table names.
How do I fix this when locked out of wp-admin?
Connect via phpMyAdmin and verify whether the missing tables exist under a different prefix. If so, edit wp-config.php via SFTP to match. If tables are genuinely missing, restore the most recent complete database backup via phpMyAdmin’s Import function.
Can this error hurt my SEO?
Yes. A missing core table prevents all WordPress pages from loading. Search engines encountering errors on every URL will begin de-indexing pages if the error persists for days. After resolving the error, submit your sitemap in Google Search Console to prompt recrawling.
What is the difference between this error and “Error Establishing a Database Connection”?
The Error Establishing a Database Connection means WordPress cannot connect to the database server at all — wrong credentials, server down, or the database doesn’t exist. “Table doesn’t exist” means the connection succeeded but a specific table is absent. Both produce error pages but have different fixes.
Is it safe to delete tables from phpMyAdmin?
Deleting core WordPress tables is never safe unless permanently removing an installation. Deleting plugin tables removes all stored data — form submissions, order history, configurations. Always export a table before deleting it, even if you believe the data is no longer needed.
Related Glossary Terms
- Database
- MySQL
- MariaDB
- Error Establishing a Database Connection
- phpMyAdmin
- wp-config
- SFTP (Secure File Transfer Protocol)
- Specified Key Was Too Long
How CyberOptik Can Help
Still broken? Our team fixes WordPress errors like this in under 30 minutes for maintenance clients. Missing table errors from botched migrations need someone who can assess the database state, determine whether a restore or repair is the right path, and execute it without data loss. Our WordPress maintenance plans include daily backups and migration support so that recovery from this kind of error is measured in minutes, not hours. Contact us to discuss your database recovery.

