Delete Multisite deleted blog DB

Good Morning
I delete 70 blog from a wp DB multisite and database contain different empty base
DB are name like : "code_BlogNumber_table-name"
Can I delete table from DB with deleted BlogNumber, and How can I find specific table to delete ?

Thank you

  • Adam Czajczyk

    Hello Laurent_C,

    I hope you're well today and thank you for your question!

    In WordPress Multisite there are tables in database named according to this scheme:

    prefix_NUM_tablename

    where

    - "prefix" is your installation current DB prefix defined inside "wp-config.php" file
    - "NUM" is an ID of the sub-site (blog)
    - "tablename" is a name of table (e.g. posts, postmeta etc)

    When you delete site from your network by going (as a super-admin) to your "Network Admin -> Sites -> All sites" page and clicking on "Delete" link for selected site, all the tables assigned to that site should be automatically removed as well.

    For example, let's say you're removing site that's got an ID of "10" (you can find out that ID on your "All sites" sites list by hovering mouse pointer over site's name and taking a look at URL displayed in browser status bar, like this: yourdomain.com/wp-admin/network/site-info.php?id=10).

    All the tables assigned to that page will include "10" as shown below:

    wp_10_posts
    wp_10_postmeta

    etc.

    These tables should be automatically removed when you delete site as via your Network Admin dashboard.

    Do I understand correctly that despite the fact you removed pages, these tables (empty) are still there? If you're sure that the site (blog) is deleted but database tables containing an ID of that blog are still there, you may remove the from your database but I'd made 100% sure that they're indeed empty and assigned to that blog. These table are sorted "in order" so you may use "phpMyAdmin" on your server to find them on table list, then check the checkbox to each of them and select "Delete" from the drop-down box below the "Structure" list.

    Please make a full database backup first as this is a risky operation and in case anything goes wrong your site may break.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.