Database Cleaner, Scheduled Table Optimization & Autoload Bloat Inspector
Keep MySQL lean for sub-200ms Server TTFB by cleaning revisions, expired transients, and orphaned postmeta, scheduling automated OPTIMIZE TABLE runs, and auditing your Top 5 Heaviest Autoloaded wp_options.
📋 On This Page (Jump to Section)
Even with fast frontend assets, a bloated MySQL database slows down every uncached request, WooCommerce checkout action, and wp-admin page load. Module 2 (Database & Autoload Cleaner) keeps your database fast and exposes hidden wp_options memory bottlenecks.
1. 1-Click & Scheduled MySQL Garbage Cleanup #
Navigate to FBS Optimize → Speed & Database and scroll to the Database & Autoload Cleaner card. You can selectively check or uncheck any cleanup target before running a manual or scheduled sweep:
| Cleanup Target | What Is Removed & Safety Rules |
|---|---|
| Post Revisions | Deletes old historical revision snapshots (post_type = 'revision') while leaving all published, draft, scheduled, and private posts 100% untouched. |
Old Auto-Drafts (> 7 Days) |
Removes abandoned auto-draft rows older than 7 days (preserving any active draft currently being edited by an author today). |
| Trashed & Spam Comments | Permanently purges comments sitting in the spam or trash queues along with their orphaned commentmeta. |
| Expired Transients | Scans wp_options for _transient_timeout_* records whose expiration timestamp has already passed and removes both the timeout row and value row. |
| Orphaned Postmeta | Deletes dangling rows in wp_postmeta whose parent post_id no longer exists in wp_posts. |
| Optimize Database Tables | Executes MySQL OPTIMIZE TABLE across core WordPress tables to defragment data pages and reclaim disk overhead after bulk deletions. |
2. Automated WP-Cron Cleanup Schedules #
Want your database to stay clean automatically without manual maintenance? Set the Automated Cleanup Schedule dropdown to:
- Disabled (Manual Only)
- Daily (Recommended for high-volume WooCommerce stores)
- Weekly (Recommended for standard business sites and blogs)
- Monthly
When enabled, FBS Secure Optimize registers a lightweight background WP-Cron event that executes your selected cleanup tasks during off-peak traffic.
3. Diagnosing High TTFB with the Autoload Bloat Inspector #
On every single page load—frontend, REST API, AJAX, or admin—WordPress loads all rows from wp_options marked with autoload enabled. If deactivated or poorly coded plugins leave megabytes of serialized arrays set to autoload, your server Time to First Byte (TTFB) spikes dramatically.
The built-in Autoload Bloat Inspector inside Module 2 shows you:
- Total Autoloaded Size (KB / MB): Color-coded health badge (Healthy below
800 KB; Warning above1,000 KB). - Top 5 Heaviest Autoloaded
wp_optionsTable: Lists the exactoption_nameand payload size (in KB) of the 5 largest autoloaded rows in your database so you can immediately identify which plugin or legacy option is consuming server memory.