WP Multisite DB has two sites but I want only One

What issue or error are you experiencing?

I created two sites using WP Multisite on my local PC - “testsite” and “my site”.

I want to switch XAMPP/WP to Local WP.

I tried exporting the db from XAMPP/WP twice - once from the PHPAdmin and once from within WPMulti using a plugin.

I can import into Local fine, but I can only work with the first site “testsite” even though the DB contains both sites. For example, the table names are “wp_links” and “wp_2_links”, etc.

It seems that only the tables without the “_2” are being used.

Can I use the Local DB interface to remove the “wp_links” table and rename “wp_2_links” ?

Will that work to restore my second site if I remove/rename all the associated tables?


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version: Version 9.2.9+6887

  • Operating System (OS) and OS version: Windows Pro 11


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

I resolved this on my own - please ignore.

I would delete this post if I could find a ‘delete’ button/option/link.

I’m glad you were able to resolve this @wehoit! If you want to share any details on your resolution I could simply “close” your post afterward? If you’d prefer to just wipe it out and delete everything I can do that too. Keep us posted and we’d be happy to help further!

Sure - I’ll share some details and you can close it.

Maybe it will help someone else.

My DB from XAMPP was from using WP as multisite.

When you use multisite, the first site created cannot be deleted (not through the UI anyway).

So when I created multiple testing sites, I ended up wanting only one of them and deleted the rest.

This left me with “testsite” and “MySite”. In the DB it was effectively tables with “wp_” prefix (for ‘testsite’) and "tables with “wp_4_” prefix (for ‘MySite’).

I don’t recall the exact numbers, but there were about 12 tables in common (i.e. ‘_options’) and about 6 with only the “wp_” prefix.

I exported a backup of the DB then started editing.

I assumed that the common ones with “wp_” were for “testsite” could be deleted. So I did that, then renamed the others by removing the “wp_4_” prefix, effectively replacing the ones I assumed were for “testsite” and replacing them with the ones from “MySite”.

After doing this I shutdown XAMPP, removed the multisite specific settings from “wp-config.php”, and resarted XAMPP.

I found that most (no images) of my data was now visible in a single site XAMPP environment - yay!

However, when I went to access WP admin to try and tweak the site I got errors - mostly 404.

So I edited the DB one more time and found every instance of “wp_4_” in the data and changed it to “wp_”. Now I was able to use the admin/editing tools in WP XAMPP.

Lastly, I kept getting a lot of import errors in Local, so I unzipped the export and found a terrible file structure that included folders that referenced “C_”, tons of files/folders that were unnecessary and empty, and more.

I did a lot of site exports from both XAMPP (WP Migrate Lite) and Local so I’m a bit fuzzy on the export structure issue. I know it happened but I can’t recall which site export had the problem.

I rebuilt the zip to a simple structure (as shown on the Local support pages) and when I imported it, the site worked. I had to reimport my media(images) and reinstall the Theme.

After that, everything works properly.

By the way - “Local” is a terrible name - it’s such a common word. Searches for “Local” on the web and my pc return all kinds of unrelated stuff - please change it WPLocal or something unique.