Cleaning out unused tables in your WordPress Blog

Today I moved my database from a MySQL 4 database server to a MySQL 5 database server, for no reason other than to move to 5. But I found a ton of tables in my database for various plugins that I knew I was no longer using. In fact, I had disabled ALL plugins shortly before this move.  I wanted to go in and delete all tables except those absolutely required for a base wordpress install.

To do the clean up I used two things:

  • a plugin called CleanOptions for WordPress
  • a MySQL database client

Before the cleanup

Here’s what my tables looked like before:

image 

and

image

After the cleanup here’s what was left

image

Here’s how I did it.

Step 1 backup your database (you never know)

Step 2 remove database tables I no longer require

By working off the Database Description in the WordPress Codex I was able to identify what tables were absolutely required by WordPress in a default install. Since all plugins were deleted/disabled all other tables were not needed. So I nuked them.

Step 3 remove all options no longer required.

This involved installing and executing the Clean Options plugin and best I can tell it got everything.

Finally re-enable the plugins I required

The only plugins I kept after this clean up were Akismet, WP-SuperCache (I didn’t need to hack it to work, it just worked this time) and a lightbox plugin that I need to re-enable. I like to test out and install plugins so I had so much garbage in there over the past few years that I really needed to clean house. Well, the house is very clean now I also deleted more than 120 different themes I had tested over the years and only have the default themes and the one I’m currently using enabled now.

author avatar
Jess
With a background in web development and web server administration dating back to 1994, Jess Coburn founded Applied Innovations in 1999. As CEO, he led the company to become a recognized leader in Windows Hosting, specializing in ASP.NET, E-Commerce, and advanced web application hosting. Under Jess's leadership, Applied Innovations became known for making cutting-edge technology accessible and affordable for businesses. Building on this success, Jess expanded his vision by founding QIT Solutions, a managed cloud, IT, and cybersecurity company, where he continues to leverage his extensive industry experience to deliver innovative and secure IT solutions to businesses.

1 thought on “Cleaning out unused tables in your WordPress Blog”

  1. Pingback: Cleaning out unused tables in your WordPress Blog | patio set

Leave a Comment

Scroll to Top