Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Developer · Guide

How to Remove WordPress Plugin From Database (Step by Step)

How to Remove WordPress Plugin From Database (Step by Step)

Short answer

Back up the database, then delete the plugin from the dashboard so its uninstall routine runs. Next, remove leftover tables, wp_options rows, post meta and cron events that use the plugin's prefix with phpMyAdmin, WP-CLI or a cleanup plugin.

Key takeaways

  • Deleting plugin files does not always delete plugin data.
  • Always back up the database before removing rows or tables.
  • Use the plugin's own delete-data setting when available.
  • Match the plugin's exact prefix to avoid removing other data.
  • WP-CLI handles options, tables and cron events quickly.

How do you remove a WordPress plugin from the database?

Back up the database, deactivate and delete the plugin, then find and remove its leftover tables, options, post meta and cron events using phpMyAdmin, WP-CLI or a database cleanup plugin.

Deleting a plugin from the Plugins screen removes its files. Whether it also removes its database data depends on the plugin.

Well-built plugins include an uninstall routine that cleans up after itself. Many plugins leave data behind on purpose, so you keep your settings if you reinstall later.

Over time, those leftovers add clutter. Large autoloaded options can even slow every page load.

What data do plugins leave in the database?

Plugins can leave custom tables, rows in wp_options, post meta and user meta, transients, scheduled cron events, custom post types and taxonomy terms after you delete them.

Leftover typeWhere it livesHow to spot it
Custom tablesOwn tables such as wp_pluginname_logsTable name prefix matches plugin
Settingswp_optionsoption_name starts with plugin prefix
Transientswp_optionsNames start with _transient_ and plugin prefix
Post metawp_postmetameta_key uses plugin prefix
User metawp_usermetameta_key uses plugin prefix
Cron eventscron option in wp_optionsHook names match the plugin
Contentwp_postsCustom post_type values

Your table prefix may differ from wp_. Check the $table_prefix line in wp-config.php.

What should you do before deleting anything?

Take a full database backup, confirm the plugin is really gone or no longer needed, and identify its exact prefix so you do not delete data that belongs to another plugin or to WordPress core.

Database deletions cannot be undone without a backup. Follow our guide on how to back up a WordPress database first.

Then:

  1. Write down the plugin's name and slug.
  2. Look at the plugin's code or documentation for its option names and table names, if you still have the files.
  3. Test on a staging site if the data is large or the site is busy.

Some plugins share prefixes with related add-ons. Removing data shared with an active plugin can break it.

How do you find the plugin's prefix?

The prefix is the short label a plugin adds to its option, table and meta names, and you can find it in the plugin's code, documentation or wp_options table.

Most plugins use a prefix based on their name. For example, Yoast SEO uses wpseo, and many plugins use a short version of their slug.

Ways to find it:

  • Open the plugin's main PHP file and search for get_option( or add_option( calls.
  • Look at the tables list in phpMyAdmin for names that obviously match the plugin.
  • Sort wp_options by option_name and scan for groups of similar names.
  • Check the plugin's support forum, where users often ask about leftover data.

Write the exact prefix down before running any query. A precise prefix is your main protection against deleting the wrong rows.

How do you check whether the plugin cleans up itself?

Reactivate the plugin and look for a setting such as Delete data on uninstall, or check whether the plugin folder contains an uninstall.php file before deleting it from the Plugins screen.

WordPress runs a plugin's uninstall.php file or registered uninstall hook when you delete the plugin from Plugins > Installed Plugins. It does not run when you delete files over FTP.

The plugin uninstall methods documentation explains how this works.

Many plugins, such as form, SEO and ecommerce plugins, hide cleanup behind a setting. Turn it on, save, then delete the plugin through the dashboard. This is the cleanest removal.

If the plugin is broken and will not activate, see how to uninstall broken plugins.

How do you remove plugin tables in phpMyAdmin?

Open phpMyAdmin from your hosting panel, select the WordPress database, tick the tables that start with the plugin's prefix, choose Drop from the action menu, and confirm.

Steps:

  1. Log in to your hosting panel and open phpMyAdmin.
  2. Select your WordPress database in the left column.
  3. Look for tables named after the plugin, for example wp_wpforms_ or wp_redirection_.
  4. Tick only those tables.
  5. Choose Drop from the With selected menu.
  6. Read the confirmation and click Yes.

The phpMyAdmin documentation covers the interface in detail.

Never drop core tables such as wp_posts, wp_options, wp_users or wp_postmeta.

Before dropping a table, click it and use the Browse tab to look at a few rows. If the data looks like logs, entries or settings from the removed plugin, you are in the right place. If you see content you still need, export the table first using the Export tab.

How do you remove plugin options?

Search wp_options for option names that start with the plugin's prefix, review the results, and delete only the rows that clearly belong to the removed plugin.

In phpMyAdmin, open the SQL tab and run a search first:

SELECT option_name, LENGTH(option_value) AS size, autoload
FROM wp_options
WHERE option_name LIKE 'pluginprefix\_%';

Review the list. When you are sure, delete them:

DELETE FROM wp_options
WHERE option_name LIKE 'pluginprefix\_%';

The backslash escapes the underscore, which is a wildcard in SQL LIKE patterns. The MySQL DELETE reference explains the syntax.

Also check for transients with names like _transient_pluginprefix_ and _transient_timeout_pluginprefix_. Our guide on what a transient is in WordPress explains these rows.

How do you remove plugin data with WP-CLI?

With WP-CLI you can list and delete options, drop tables, and remove cron events from the command line, which is faster and safer than editing large tables in a browser.

Useful commands:

wp db export backup.sql
wp option list --search="pluginprefix_*" --fields=option_name
wp option delete pluginprefix_settings
wp db tables "wp_pluginprefix_*"
wp db query "DROP TABLE wp_pluginprefix_logs"
wp cron event list
wp cron event delete pluginprefix_daily_task
wp transient delete --all

The wp option delete reference and wp cron event delete reference list the options for each command.

wp transient delete --all removes all transients, not just the plugin's. That is usually safe because transients rebuild, but it can briefly slow the first page loads.

Our list of useful WP-CLI commands covers more database tasks.

How do you remove post meta and user meta?

Search wp_postmeta and wp_usermeta for meta keys that use the plugin's prefix, check the matches, and delete them with a targeted DELETE query.

Example:

DELETE FROM wp_postmeta
WHERE meta_key LIKE '\_pluginprefix\_%';

Many plugins prefix meta keys with an underscore to hide them from the custom fields panel. Search with and without the leading underscore.

Large wp_postmeta tables can take a while. Run heavy queries at quiet times.

Run a SELECT COUNT(*) query with the same WHERE clause first. The count tells you how many rows will go, so you can spot a pattern that matches far more data than expected.

Can a cleanup plugin do this for you?

Yes, database cleanup plugins such as Advanced Database Cleaner can scan for orphaned tables, options and cron jobs, and some try to match them to the plugin that created them.

Advanced Database Cleaner and similar tools show items that no active plugin seems to use. Review their suggestions carefully. Detection is based on names and can be wrong.

After cleanup, uninstall the cleanup plugin too if you only needed it once.

How do you check the cleanup worked?

Reload the site and dashboard, check that other plugins still work, then optionally optimize tables and compare database size or autoloaded data before and after.

Steps:

  • Browse key pages and test forms, checkout and login.
  • Look at Tools > Site Health for new warnings.
  • Run Optimize table in phpMyAdmin or wp db optimize to reclaim space.

Our guide on reducing autoloaded options shows how to measure the gain.

What if something breaks after cleanup?

If something breaks, restore the database backup you made before cleanup, then repeat the process more carefully with a narrower prefix or on a staging copy.

Common mistakes include deleting data used by a related add-on, removing options that a theme also reads, or matching a prefix that is too short.

Use full, specific prefixes like wpseo_ rather than short ones like wp. When in doubt, leave a row in place. A few unused rows do far less harm than a missing setting.

For a broader tidy-up, see how to clean up a WordPress site.

Frequently asked questions

Does deleting a plugin remove its database tables?

Only if the plugin includes an uninstall routine that removes them and you delete it from the Plugins screen. Many plugins keep their data on purpose so settings return if you reinstall. Deleting plugin files over FTP never runs the uninstall routine.

Is it safe to delete plugin tables in phpMyAdmin?

It is safe if you take a full backup first and only drop tables that clearly belong to the removed plugin. Never touch core WordPress tables. If you are unsure, test the deletion on a staging copy of your site.

How do I find which plugin created a database table?

Look at the table name, which usually includes the plugin's prefix or name. Search the prefix online or in the plugin's code. Cleanup plugins can also guess the owner, but treat their suggestions as hints and check them yourself.

Will removing leftover plugin data speed up my site?

It can, especially if the plugin left large autoloaded options that load on every request. Removing unused tables saves space but rarely changes speed much. The biggest gains usually come from cleaning large autoloaded options and old transients.

What happens if I delete the wrong option?

The plugin or theme that used it may lose settings or stop working correctly. Restore your database backup to undo the change. This is why backing up and using specific prefixes before deleting anything is so important.

Sources

  1. Uninstall Methods WordPress Developer Resources
  2. wp option delete WordPress Developer Resources
  3. phpMyAdmin Documentation phpMyAdmin
  4. DELETE Statement MySQL Reference Manual
  5. Advanced Database Cleaner WordPress.org Plugin Directory

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.