Connect with us

Hi, what are you looking for?


Tutorial: Remove leftover plugin database tables from WordPress

Remove Leftover Plugin Database Tables From WordPress

Did you know that uninstalling WordPress plugins from the dashboard is simply not enough?

Many website owners have most likely installed and tested several WordPress plugins but are probably unaware that every time they do they are also creating new database tables that are not removed when plugins are uninstalled.

This overtime will have an effect on your website as the database starts to accumulate a lot of junk tables and this, in turn, will increase the size unnecessarily causing load and speed issues.

Note: Please be aware that not all plugins create database tables and some plugins do give you the option to remove them when uninstalled.

Now the reason most plugins do not delete database tables is that the plugin developer hasn’t added the function to do so. It is as simple as that.

So how do you remove unwanted database tables?

There are two ways to do this:

  1. Dig into your database tables and delete them manually via PHPmyAdmin
  2. Install plugins that can do the job for you directly from inside WordPress
Important!: Always backup your database before attempting to make any changes.

Deleting WordPress tables manually via PHPmyAdmin

The first option is not recommended unless you know exactly what you are doing. You will need to know The default WordPress database structure and be able to identify tables that have nothing to do with the core. On top of that, you will need to know which tables belong to which plugins and this can prove to be a little overwhelming.

Let me show you what the WordPress database looks like without any plugins installed. In the example below, you will see that the default database has 12 tables.

On the same database, I have installed the popular security plugin WordFence. You will notice that the database no longer has 12 tables, it now has 32. This is because the plugin has added an additional 20 tables.

Since I have only installed WordFence I can instantly identify the new tables which are not required for WordPress to function. I will now uninstall the plugin and show you what the database looks like after it has been removed.

Wordfence has the option to delete all tables and data inserted by the plugin which is what you hope all plugin developers did. Sadly this is not the case.

Voila there you have it, can you tell the difference?

No, you can’t, this is because upon uninstalling the plugin no database tables were removed. Now can you imagine what happens after several days, months, years of constantly adding and removing plugins? The database will start to struggle and you will start noticing that your website is no longer running as fast as it once used to.

As I have identified and know exactly what database tables were added by the plugin I can now go ahead and check the tables and drop (delete) them. I won’t be going into detail about PHPMyAdmin functions today but here is a cool video by HostGator explaining how to DROP database tables.

Use plugins to delete leftover database tables

Using a plugin specifically developed to clean leftover database tables may be the best and easiest option if you do not feel comfortable jumping into PHPMyAdmin. Please remember and I can’t stress this enough, DO NOT attempt to make any changes to your database without BACKING UP. There is no turning back once you have deleted a database table.

The plugin I recommend using is Plugins Garbage Collector. What this plugin does is scans your WordPress database and displays old plugin tables that were left behind.

Once the plugin is installed you will see the following options.

For this example, I am going to remain using WordFence’s database tables as a reference.

As you can see the scan has recognised all tables that are not part of the WordPress core. It shows all database tables left behind by WordFence. I will check all tables and hit Delete Tables.

Result. All left over tables have been removed. Now that may have seemed easy enough to do but remember there was only one plugin installed. If you have removed several plugins you will see loads more tables which you will need to identify and make sure they do not belong to any other plugin that you are currently using. The plugin does assist in this by displaying plugin name and state.

Additional Data

Some plugins also save options within your main WordPress core tables so you may also want to install Clean Options, a neat tool which cleans up any options in your wp_options table which have become orphaned after you deleted the plugin.

Now before you try any of the above I would suggest you optimise your database to remove any other junk beforehand. For that I recommend you use WP Sweep –  it allows you to clean up unused, orphaned, and duplicated data in WordPress. It also optimizes your database tables.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *


More On The Net BLog


As per our previous announcement, the Website Helper blog has now become Here we have it, 36 approved UK business directories you can...


CSS media queries are an excellent way to deliver different styles to different devices. Here are CSS Media Queries for targeting your iPad in...

Web Hosting

GoDaddy has become a household brand, they are one of the biggest website hosting and domain name companies in the world. However, being the biggest does...


Are you looking for alternatives to to outsource your next project? For those that don’t know what is, it’s an online freelance micro job...


Traffic is bad on the road. But it is a blessing on a website or blog- as long as your bandwidth can handle it....


The problem faced by many WordPress websites using contact forms is spamming. It is frustrating and time-consuming to deal with. Spamming happens when malicious...


CSS media queries are an excellent way to deliver different styles to different devices. The rapid growth of mobile devices has made it a...


Whether you are a freelancer or a business with several employees, in this day and age,  you will need to have a website. A...