WordPress plugins are easy to install and use. However when it comes to deleting them from our blog and database, it may not be so straightforward. There is always a possibility that when you delete the unwanted plugin(s) from your WordPress dashboard, the files get deleted, but the plugin’s tables are not removed from the database. These tables are we call orphaned or obsolete tables. As a result, your database get bigger unnecessarily, slows your blog down, and increase the time you do backups.
Before we begin
The two common and probably the easiest way to remove orphaned tables are using phpMyAdmin and WordPress plugins. As a precaution, before you start on any of the method, please do your backups – both your WordPress files and database.
When you have doubts on deleting a table from your database, hold on and do the necessary research on Google first. Since most of the WordPress plugins have a standard way of naming their tables in the SQL database, you can easily find out the plugin name using the database table name. If you are still using the plugin, don’t touch that table, you need to keep it. Let’s look at the ways to remove orphaned tables from our databases.
Using phpMyAdmin to Remove Obsolete & Orphaned Tables
- First, login to your hosting account dashboard, then look for the phpMyAdmin icon. In this guide, I am using Hostgator cPanel, so phpMyAdmin may appear different compared to my screenshots. However the following steps can still be applied.
- Once you enter into phpMyAdmin, on the left-hand side, select the database where the table(s) is residing on.
- Click on Structure located at the top of the page.
- Look for the table that you want to Empty or Drop, and click to execute. Empty means removing the data in the table, and keeping the structure. Drop means deleting the entire table & data from the database.
- phpMyAdmin will give a pop-up requesting for confirmation. Note that both actions are irreversible.
- Repeat the steps for any tables that you want to remove.
Using WordPress Plugins to Remove Obsolete & Orphaned Tables
For this guide, we will be using WP-DBManager to remove orphaned tables that are left behind after we deleted the plugins.
- Access WP-DBManager from the left-hand side of your WordPress dashboard, Database > Empty/Drop Tables
- Look for the obsolete and/or orphaned database tables that you want to empty/drop. As the actions are non-reversible, do take extreme care before you execute your actions. As a gentle reminder, please backup if you have not done so.
- That’s it! Your database size is now smaller and cleaner.
Suggestions & Tips
Tip #1: Start investigating on those tables that are bigger in size first.
Tip #2: Be mentally prepared that you may delete a table wrongly, and need to do backup & recovery.
Tip #3: It’s recommended that you do this clean-up in the morning. You won’t want to spend a sleepless night trying to fix your website or database when things get broken unexpectedly.
Tip #4: If you are using WordPress plugins to do the clean-up, it is advisable that you test it out first, before using on your actual/live website. Reason is because there can be incompatibility issues caused between your theme, settings or plugins.
Tip #5: You may want to remove unwanted plugin options from your wp_options table too.
Latest posts by lincoln (see all)
- Twitter Search Operators for Geeks – Change the Way You Search - April 21, 2016
- How to Auto Publish from Instagram to WordPress Using Instagrate - April 19, 2016
- 20 Best Ways to Use Twitter Advanced Search to Find Leads - April 17, 2016