What are “tables to optimize”?
As your site runs, database tables accumulate overhead (fragmented free space) from inserts, updates, and deletes. “Tables to optimize” are tables with measurable overhead that can be reclaimed to reduce size and improve I/O efficiency. Optimizing them reorganizes storage and updates table statistics.
How they affect your database?
Overhead makes tables larger on disk and can slow some queries and backups. It’s normal to have some overhead, but large values – especially on busy sites – waste storage and may degrade performance over time.
How to clean them?
1. Using Advanced Database Cleaner plugin
Open the General Cleanup module in Advanced Database Cleaner plugin,
select “Tables to optimize” and run the cleanup. The plugin detects tables with overhead and executes safe optimization routines.
2. Using a raw SQL query
If you prefer a manual optimization, you can run the following SQL command in phpMyAdmin for example:
First, list tables with overhead, then run OPTIMIZE TABLE on chosen tables:
-- List tables and see Data_free (overhead)
SHOW TABLE STATUS;
-- Example: optimize specific tables
OPTIMIZE TABLE wp_posts, wp_postmeta, wp_comments;
Note:
While you can manually run these SQL commands to optimize your database tables, we strongly recommend using the Advanced Database Cleaner plugin.
It performs table optimization safely through WordPress’s internal methods, automatically handles multisite installations, and ensures that all tables are compacted and optimized without risking data corruption or index loss.