Overview
Over time, databases become fragmented and grow in size. Optimizing and repairing tables helps keep your website fast and stable.
Option 1 — Optimize using phpMyAdmin
- Open phpMyAdmin
- Select your database
- Scroll to the bottom and click Check All
- Select:
Optimize table
Option 2 — Repair corrupted tables
If you see errors like “table is marked as crashed”, run this:
- In phpMyAdmin, select your database
- Check the broken tables
- Select:
Repair table
Option 3 — Optimize via SQL command
OPTIMIZE TABLE wp_posts; OPTIMIZE TABLE wp_options; OPTIMIZE TABLE wp_postmeta;
Option 4 — CLI Optimization (SSH)
mysqlcheck -o --user=username_dbuser -p username_dbname
Performance tips
- Clean up post revisions (WordPress)
- Clear WooCommerce sessions
- Delete old plugins/tables
- Enable object caching