Cleanup Removed Plugins

Find and clean up the database mess that plugins and themes leave behind after removal. Orphaned tables, forgotten options, zombie cron jobs, and stale metadata accumulate over time, wasting disk space and slowing down queries. This module identifies them and lets you remove them safely.

This module is in beta. Always back up your database before running cleanup operations. While the module includes safeguards to protect WordPress core data, database deletions are permanent and cannot be undone.

Use Cases

  • Orphaned Table Detection – Find database tables left behind by plugins you deleted months or years ago, reclaiming storage and reducing backup sizes
  • Leftover Options Cleanup – Remove hundreds of wp_options entries from plugins that never cleaned up after themselves, speeding up autoloaded option queries
  • Zombie Cron Jobs – Identify and remove scheduled tasks from plugins that no longer exist, reducing overhead on every page load
  • Database Archaeology – Investigate what is actually in your database and which old plugins left traces behind, especially useful when inheriting a site from another developer

How It Works

  1. Open the Cleanup Removed Plugins dashboard from the Switchboard menu
  2. The module scans your database for orphaned tables, wp_options entries, and cron jobs
  3. Each item is identified by its likely source plugin (matched against 60+ known plugin prefixes) and assigned a risk level
  4. Review the results and select items to delete individually or in bulk
  5. Optionally add items to the ignore list to skip them in future scans
  6. All deletions are logged in the cleanup history (last 100 actions retained)

Where to Find It

Location: Navigate to Switchboard → Cleanup Removed Plugins (admin.php?page=switchboard-cleanup-removed-plugins) for the full cleanup dashboard.

You can also access module settings through Switchboard → Modules → Optimization → Cleanup Removed Plugins.

What Gets Scanned

Orphaned Database Tables

The module compares all tables in your database against:

  • WordPress core tables (always protected)
  • Tables belonging to currently active plugins
  • Known plugin table prefixes (60+ plugins recognized)

Any table that does not belong to WordPress core or an active plugin is flagged as orphaned.

Orphaned wp_options Entries

Options in the wp_options table are matched against known plugin prefixes. Entries from plugins that are no longer installed are flagged for review.

Zombie Cron Jobs

WordPress cron events registered by plugins that no longer exist continue to fire (and fail silently) on every page load. The module identifies these orphaned scheduled tasks.

Risk Levels

Risk LevelMeaningWhen It Appears
LowSource plugin identifiedThe module recognizes the plugin that created this item based on known prefixes
MediumUnknown sourceThe item does not match any known plugin prefix – manual review recommended

Start by cleaning up low-risk items first. These have a known source plugin and are safe to remove. For medium-risk items, use the prefix linking feature to associate unknown prefixes with plugins you recognize.

Features

Individual and Bulk Cleanup

Delete items one at a time for careful review, or select multiple items and clean them all at once. Both approaches log every action.

Ignore List

Mark items you want to keep (such as tables from custom code or shared plugins) so they do not appear in future scans. You can manage the ignore list from the dashboard.

Prefix Linking

When the module encounters an unknown database prefix, you can manually associate it with an active plugin. This teaches the module to recognize that prefix in future scans and lowers the risk level for matching items.

Cleanup Log

Every deletion is recorded with a timestamp, the item name, and its type. The log retains the last 100 entries for auditing purposes.

Safety Protections

The module includes multiple safeguards to prevent accidental damage:

  • WordPress core tables are always protected and cannot be deleted
  • WordPress core options are always protected and cannot be removed
  • All actions require explicit user confirmation
  • Deletions are logged for accountability
  • The ignore list prevents accidental removal of intentionally kept items

FAQ

Will this module delete tables from active plugins?No. The module only flags tables and options from plugins that are not currently active. Active plugin data is always protected. If you deactivate a plugin without deleting it, its data may be flagged as orphaned since the module checks against the list of active plugins.
Can I undo a cleanup action?No. Database deletions are permanent. This is why backing up your database before running cleanup operations is essential. The cleanup log records what was deleted, which can help you identify what to restore from a backup if needed.
How does the module identify which plugin created a table?The module maintains a built-in database of 60+ known plugin prefixes (e.g., wc_ for WooCommerce, yoast for Yoast SEO, elementor for Elementor). It matches table names and option keys against these prefixes. For unrecognized prefixes, you can use the prefix linking feature to teach the module.
Is it safe to remove orphaned cron jobs?Yes, if the plugin that registered the cron job is no longer installed. These zombie cron jobs fire on schedule but have no callback function to execute, resulting in silent errors. Removing them eliminates unnecessary overhead.
How much space can I expect to reclaim?It depends entirely on your site’s history. Sites that have tested dozens of plugins over several years can accumulate hundreds of megabytes of orphaned data. Typical cleanups on moderately active sites reclaim anywhere from 10 MB to 500+ MB of database space.

This module scans and cleans your WordPress database only. It does not remove leftover plugin files from the filesystem. To clean up unused plugin and theme files, use the Remove Unused Themes & Plugins module.

PRO

Get access to all 166 modules with a single license

Upgrade to Pro