How to Delete Unused Database Tables in WordPress

2025-11-13

When you install a plugin in WordPress, it automatically creates all the necessary folders, files, and database tables for it to work properly. However, when you deactivate and remove the same plugin, it may not delete the database tables along with the files and folders.

For instance, when I deactivated and deleted a plugin called Wordfence, it did not delete its more than twenty database tables along with the created files and folders.

wp-delete-plugin-db-tables-wordfence-database-tables

More often than not, plugin developers intentionally choose not to delete the plugin tables when you uninstall a plugin. There are many reasons for this behavior, but the most popular reason is to retain user settings, data, and other options within your database so that they can be restored when you reactivate the plugin.

Retaining settings and user data is a good thing. However, with all the plugins you install and uninstall over time, the database size may increase due to the leftover database tables. Moreover, any leftover plugin database table may prove to be a potential liability.

Here’s how to delete all those leftover database tables in WordPress with just a few clicks.

Also read: How to Set Up WordPress Using Docker in Ubuntu

Delete Leftover Plugin Database Tables

Note: Before making any changes, it is very important that you back up your WordPress database. The backup helps restore your site in the event of any unintended consequences. If necessary, back up your entire WordPress site, just to be sure.

For most things in WordPress, there is a plugin called Plugins Garbage Collector. It is specifically designed to find and delete leftover tables.

1. Open your WordPress dashboard and navigate to “Plugins -> Add new.” Search for the “Plugins Garbage Collector” plugin. From the search results, install and activate the plugin.

wp-delete-plugin-db-tables-install-activate-pgc-plugin

After activating the plugin, go to the “Tools -> Plugins Garbage Collector” page, select the “Search non-WP tables” radio option, and click on the “Scan Database” button.

wp-delete-plugin-db-tables-scan-database

After completing the scan, the plugin will display all the database tables that are not related to the core of WordPress or any of the installed plugins. Generally, these are the tables that are left over after deleting a plugin.

wp-delete-plugin-db-tables-left-over-database-table-list

There is no select all option for obvious reasons, so double check each and every table and manually select all the tables you want to delete. Then, scroll down and click on the “Delete Tables” button. Again, only press this button if you are sure and have a good database backup.

wp-delete-plugin-db-tables-click-delete-tables-button

If everything goes well, you’ve successfully deleted all the leftover plugin tables, and your site is still working as it should. While you are at it, you can use plugins like WP-Optimize to further clean and optimize your WordPress database.

wp-delete-plugin-db-tables-tables-deleted

Comment below sharing your thoughts and experiences regarding using this approach to delete unused and leftover plugin database tables in WordPress.

Comments on " How to Delete Unused Database Tables in WordPress" :

    Leave a Reply

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

    Related Article

    How to Prevent and Report Online Harrassment and Cyberstalking
    INTERNET

    How to Prevent and Report Online Harrassment and Cyberstalking

    Online relationships certainly have evolved since the time of MySpace, and with that comes a number

    How To Avoid Limiting on Your PayPal Account
    INTERNET

    How To Avoid Limiting on Your PayPal Account

    PayPal is the leading online payment service, serving the customers of 190 countries, accepting thir

    Understanding and Preventing Domain Hijacking
    INTERNET

    Understanding and Preventing Domain Hijacking

    Domain hijacking can be painful if you are browsing the Web and especially bad if you are the site o

    What Your ISP Knows About You and Why You Should Care
    INTERNET

    What Your ISP Knows About You and Why You Should Care

    It’s old news, the US internet privacy rules preventing your ISPs from selling off your browsing d

    YouTube TV Explained and How It Compares with YouTube Red
    INTERNET

    YouTube TV Explained and How It Compares with YouTube Red

    YouTube TV is a subscription membership that will deliver live TV coming from major broadcasting net

    Will Quantum Computing Render HTTPS Obsolete And Throw Your Security Away?
    INTERNET

    Will Quantum Computing Render HTTPS Obsolete And Throw Your Security Away?

    While browsing the Internet, you may have heard the term “quantum computer” at one point or anot

    How to Use Google Sheets: Key Tips to Get You Started
    INTERNET

    How to Use Google Sheets: Key Tips to Get You Started

    Ever since Windows’ inception, Microsoft Excel has been the go-to program for number-crunching, sp

    5 of the Best Firefox Quantum Add-ons for Web Developers
    INTERNET

    5 of the Best Firefox Quantum Add-ons for Web Developers

    A growing number of web developers have switched to Firefox in recent months prompted by the release

    About Netverse

    We are a premier digital platform committed to delivering high-quality content to our readers. Our mission is to provide accurate, reliable, and engaging information that adds value to our audience's daily lives.

    Our team consists of experienced content creators and subject matter experts who uphold the highest standards of professionalism. In an era of information overload, we curate content with care, ensuring our users receive only the most relevant and trustworthy information.

    Beyond just reporting facts, we focus on depth and context. Through expert analysis, comprehensive research, and clear presentation, we help our audience gain meaningful insights and make informed decisions.

    We take pride in being a trusted information source for our growing community of readers. Our user-first approach means we continuously adapt to provide content that meets our audience's evolving needs and interests.

    Innovation and excellence drive everything we do. We're committed to improving our platform and services to deliver the best possible experience for our users.