Remove Leftover WordPress Plugin Data
Clean up orphaned database tables, options, and files after uninstalling WordPress plugins to keep your site fast and your database lean.
3 min read
Uninstalling a WordPress plugin doesn’t always remove everything it created. Many plugins leave behind database tables, options rows, transients, and files that accumulate over time. A site that has been through dozens of plugins over the years can have a bloated database full of orphaned data.
Why Left-Behind Data Matters
- Slower page loads. Leftover autoloaded options are loaded on every page request, and bloated tables slow down the queries that touch them.
- Larger backups. Orphaned data inflates your backup size.
- Confusing troubleshooting. Old data can conflict with new plugins or cause unexpected behavior if you reinstall something.
How to Find Orphaned Data
Check for Extra Database Tables
- Open phpMyAdmin in cPanel
- Select your WordPress database
- Look for tables beyond the WordPress core tables (
wp_posts,wp_postmeta,wp_options,wp_users,wp_usermeta,wp_terms,wp_termmeta,wp_term_taxonomy,wp_term_relationships,wp_comments,wp_commentmeta,wp_links). Plugin tables use the same prefix (wp_by default) - Common leftovers include:
wp_actionscheduler_*(WooCommerce/Action Scheduler)wp_yoast_*(Yoast SEO)wp_redirection_*(Redirection plugin)wp_wfhits,wp_wflogins(Wordfence)wp_statisticvisitors(WP Statistics)
If a table belongs to a plugin you no longer use, you can remove it once you have a database backup.
Check wp_options for Orphans
The wp_options table is where most plugins store their settings. After uninstalling a plugin, its options rows usually stay behind.
In phpMyAdmin, run:
SELECT option_name, LENGTH(option_value) as size_bytes
FROM wp_options
WHERE autoload IN ('yes', 'on', 'auto-on', 'auto')
ORDER BY size_bytes DESC
LIMIT 50;
This shows the largest autoloaded options. WordPress 6.6 and newer store autoload as on, auto or auto-on instead of yes, so the query checks all of them. Look for entries that belong to plugins you’ve already removed.
How to Clean Up
Option 1: Use a Cleanup Plugin (Easiest)
Install one of these temporarily to run a cleanup, then remove it:
- WP-Optimize - cleans database, removes transients, optimizes tables
- Advanced Database Cleaner - finds orphaned tables and options from deleted plugins
Option 2: Manual Database Cleanup
If you know exactly what to remove:
Always back up your database before running DELETE or DROP queries. Download a copy from phpMyAdmin (Export) or use cPanel’s backup tool.
-- Delete orphaned options (example: old Yoast data)
DELETE FROM wp_options WHERE option_name LIKE 'wpseo_%';
-- Drop orphaned tables (example: old Wordfence tables)
DROP TABLE IF EXISTS wp_wfhits, wp_wflogins, wp_wfblocks7;
-- Clean up transients (safe to delete: WordPress regenerates them)
DELETE FROM wp_options WHERE option_name LIKE '_transient_%';
DELETE FROM wp_options WHERE option_name LIKE '_site_transient_%';
Option 3: Clean File Leftovers
Some plugins leave files behind in:
wp-content/(custom folders, cache directories)wp-content/uploads/(generated files, logs)- The WordPress root (
/) (some security plugins drop files here)
Check in cPanel’s File Manager under public_html/wp-content/. On a VPS, Business Cloud or dedicated server you can also list it over SSH (shared and WordPress plans have no shell):
ls -la ~/public_html/wp-content/
Look for folders that match plugins you’ve already deleted.
Optimize Tables After Cleanup
After deleting rows, optimize the tables to reclaim disk space:
-- Optimize the options table
OPTIMIZE TABLE wp_options;
-- Optimize all tables at once (phpMyAdmin: select all tables > "Optimize table")
On a VPS, Business Cloud or dedicated server with WP-CLI, you can run this instead (shared and WordPress plans have no WP-CLI, so use phpMyAdmin there):
wp db optimize
Prevention
- Before installing a plugin, check if it has a clean uninstall option (usually in the plugin’s settings page)
- Use the “Delete” button in the WordPress plugin page instead of just deactivating. Deleting triggers the plugin’s
uninstall.phpscript, which should remove its data - Keep a list of plugins you’ve tried and removed so you know what to look for during periodic cleanups
Related Articles
Last updated 21 Oct 2026, 00:00 +0300.