WordPress Optimization – Removing Leftover Data from Deleted Plugins

On this page
  1. Access phpMyAdmin
  2. Log In to the Database
  3. Open the SQL Query Editor
  4. Search for Plugin-Related Entries
  5. Example
  6. Review the Results
  7. Removing Unused Plugin Data
  8. Benefits of Removing Leftover Plugin Data
  9. Alternative Cleanup Methods
  10. Summary

One of WordPress’s greatest strengths is its extensive plugin ecosystem. Plugins allow you to add new features and functionality without modifying the core system.

During the development and maintenance of a website, it is common to install, test, and remove various plugins. While most plugins clean up after themselves when uninstalled, some leave configuration settings, cached data, or other records behind in the database.

Over time, these unnecessary entries can accumulate and increase the size of the database, potentially affecting performance and making backups larger than necessary.

This guide explains how to identify database entries that may have been left behind by plugins that are no longer in use.

Important

This guide is intended for users with basic database administration knowledge.

Before executing any SQL queries:

  • Create a complete database backup.
  • Verify that you have selected the correct database.
  • Review all results carefully before deleting any data.
  • Confirm that your website functions correctly after performing any cleanup operations.

Access phpMyAdmin

  1. Log in to the mybox Panel.
  2. Navigate to:
Databases
  1. Click:
phpMyAdmin

A new browser tab will open with the database login page.

Log In to the Database

Use the database credentials associated with your WordPress website.

If you do not know the credentials, you can find them in the wp-config.php file located in the root directory of your WordPress installation.

Example:

define('DB_NAME', 'database_name');
define('DB_USER', 'database_user');
define('DB_PASSWORD', 'database_password');
define('DB_HOST', 'database_host');

By default, the file is located in:

public_html

Open the SQL Query Editor

After logging in:

  1. Select your WordPress database from the left-hand menu.
  2. Click the:
SQL

tab located at the top of the page.

This will open the SQL query editor.

Before removing any data, identify records that belong to the plugin.

Run the following query:

SELECT *
FROM `wp_options`
WHERE `autoload` = 'yes'
AND `option_name` LIKE '%plugin-name%'

Replace:

plugin-name

with a keyword related to the plugin you previously removed.

Example

If you want to search for settings left behind by the Disqus plugin, use:

SELECT *
FROM `wp_options`
WHERE `autoload` = 'yes'
AND `option_name` LIKE '%disqus%'

Click:

Execute

to run the query.

Review the Results

The query will display records stored in the wp_options table that match the specified keyword.

Before deleting anything:

  • Verify that the records belong to the removed plugin.
  • Confirm that the plugin is no longer installed.
  • Ensure that no active plugin uses the same settings.

Carefully reviewing the results helps prevent accidental removal of data required by your website.

Removing Unused Plugin Data

After confirming that the records belong to a deleted plugin and are no longer needed, you can remove them using a DELETE query.

Example:

DELETE
FROM `wp_options`
WHERE `option_name` LIKE '%disqus%'

Warning

Always review the results returned by the SELECT query before executing any DELETE statements.

Benefits of Removing Leftover Plugin Data

Cleaning up obsolete plugin records can provide several benefits:

  • Reduced database size.
  • Faster database backups.
  • Improved database performance.
  • Reduced autoloaded data.
  • Better overall WordPress efficiency.

The benefits are especially noticeable on websites that:

  • Have been running for several years.
  • Frequently install and remove plugins.
  • Have undergone multiple redesigns or migrations.
  • Use a large number of extensions.

Alternative Cleanup Methods

If you prefer not to work directly with SQL queries, several WordPress optimization plugins can help identify and remove orphaned plugin data, including:

  • WP-Optimize
  • Advanced Database Cleaner
  • LiteSpeed Cache
  • WP Rocket

Always review suggested changes before confirming any cleanup operation.

Summary

Some WordPress plugins leave configuration data behind even after being removed. Over time, these unused records can contribute to database bloat and reduced performance.

To identify leftover plugin data:

  1. Open phpMyAdmin.
  2. Select your WordPress database.
  3. Open the SQL tab.
  4. Run:
SELECT *
FROM `wp_options`
WHERE `autoload` = 'yes'
AND `option_name` LIKE '%plugin-name%'

Replace plugin-name with a keyword associated with the plugin you want to investigate.

Before deleting any records, always create a database backup and verify that the entries are no longer required by your website.

Didn't find an answer?

Our support team is here for you 24/7 – write to us and we will help you sort it out.