I need some advice on cleaning up my database without breaking anything

I've been building my multisite network for several months now, and it's been a huge learning process with a lot of trial and error. I've installed and uninstalled lots of different plugins and created and deleted lots of different sites using WPMUdev's New Blog Templates.

So because of all this trial and error, my database is extremely cluttered and I'm thinking this can't be good for performance.

So here's my two questions:

1. Is it safe to assume that I can delete all the tables that are associated with sites on my network that I've already deleted? For instance, each database table has the prefix corresponding to the blog id of the site on the network. So any table with wp_8 refers to the site on my network with the id of 8. So since I've already deleted this site on my network, can I delete all the tables with the prefix wp_8?

2. Okay my next question refers to deleting tables on sites I still need. Because I'm using New Blog Templates, each time I create a new site, it copies over all the database tables each time. A lot of these tables are probably left over from plugins I'm no longer using, etc. And every time I create a new site with New Blog templates, I'm dragging tables I no longer need. How can I tell which tables are still being used and which ones are safe to delete?

Any advice here would be great. Thanks!

  • Jack Kitterhing

    Hi there @timstrifler

    I hope you are well today and thanks for your question.

    1: Yes, that would be the best thing to do, if the site is deleted, say blog ID 8, then you can delete all those tables that relate to blog ID 8, this will keep the database a bit less cluttered as you say! :slight_smile:

    2: If your using new blog templates, in the advanced part once created, you can choose the tables to bring across.

    If your no longer using certain plugins, this shouldn't be showing those tables, so editing your blog template and either deselecting the database tables to copy, then selecting the ones you want, this will stop other tables being copied across that you don't need and don't use :slight_smile:

    Thank you!

    Kind Regards

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.