How to clean bases (using Multi-db)?

I use 256 bases and yesterday discovered that one of my activated plugins is not showing in the plugins list.

I know what plugins list to use so the problem is real.

It seems to me that my 256 bases needs to be cleaned as I tested hundreds of plugins and now there must be a great mess in bases. Recently I installed 2 plugins with same names (from wordpress.org by the way) and now using only one of them but it is not showing (second one I deleted)... only when I changed its title to random (via build in WP plugin editor) - I can see it now.

QUESTION: How correctly clean my 256 bases? Some plugin or another solution?

  • aristath

    Hello there @Eugene, I hope you're well today!

    I don't think a plugin will do... You will either have to manually open then and delete them, or write a custom script that will allow you to get an array of your databases and run a foreach() on that array to delete their contents!
    Please keep in mind though that deleting the contents of your DBs will have as a result all your data to be deleted... it will be essentially the same as completely nuking your site and start over.

    If you need any further assistance with this then don't hesitate tio reply and we'll do our best top help out with that script, but in that case I'll need to have a copy of your multi-db configuration file. Please post that on https://gist.github.com/ so that we may further investigate.

    Cheers,
    Ari.

  • Eugene

    Howdy, Ari!

    I just found that it was AdBlock who hide that plugin. So this problem is solved. :slight_smile:

    But another one still exist (and there is no solution in Google):
    Lot's of plugins do not delete their data from bases - they don't have uninstall (neither manual nor auto). So there is a real mess in bases (useless data, tables and so on) if you (as me) tried many plugins to find the best one.

    So I and other people do need a solution to clean bases from deleted plugins. Could you (or smb from your team) create a plugin which check each table - if it is still needed or it is related to a deleted plugin and should be deleted also?

    P.S.- I am not able to find such plugin in Google...

  • aristath

    Hello again @Eugene!

    Lot's of plugins do not delete their data from bases

    True.. but that doesn't have a negative impact on your server's performance!
    Most plugins just add a couple of settings in the wp_options table, and some advanced plugins add their own custom tables.
    The main performance issue on WordPress in on the posts, postmeta and taxonomies tables. These however concert the actual content of your site that gets queried a lot and not the plugins themselves.

    Could you (or smb from your team) create a plugin which check each table - if it is still needed or it is related to a deleted plugin and should be deleted also?

    I'm afraid not!
    I'm afraid this won't be possible... there's no way to tell exactly which tables and rows are being used and which ones are simply leftovers from a now-uninstalled plugin. Chances are a plugin like that would cause more problems than it would solve!

    The only solution is this:
    NEVER do your tests on the live site.
    You should always do your development on a test or development site, and then once you find a solution that does what you need then apply these changes to your live site.

    Cheers,
    Ari.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.