WordPress Multisite: switch from subdomains to paths and reverse



NOTICE: using this method will probably make you lose data, so please read the full post before doing anything. I can’t be responsible of any damage caused to your install. I’m simply explaining how i solved my problem with my contraints. 

I recently had a little problem using WordPress multisite. When i first install the multisite site un chose to create a “sub-domain” install, that means all my sub-sites have a url similar to this structure: http://mysubsite.mymainsite.com. Everything was working fine, but i had a small issue with my hosting server and i had to stop using sub domains and start using paths (ex: http://mymainsite.com/mysubsite).

The problem is that you simply can’t do it within WordPress. So after a few minutes spent on the internet i could find and answer, and decided to to do it by myself. And here is how you can switch from a WordPress multisite install using subdomains to an install using path. Actually the revers also works.

Step 1


First step is to deactivate the multisite. So open your wp-config.php file and simply delete all lines corresponding to the multisite, basically from “define(‘WP_DEBUG’, false);” to “define(‘BLOG_ID_CURRENT_SITE’, 1);“.

Then reconnect to your admin. You now should only have your default site working as a normal WordPress install.

Step 2

Next step is to delete SQL tables corresponding to the multisite install. You can do it within PhpMyAdmin. Simply delete those tables:

  • wp_blog_versions
  • wp_blogs
  • wp_registration_log
  • wp_signups
  • wp_site
  • wp_site_meta

Please note that you will lose data like site titles etc… so it’s much better to this step before adding new websites. This step is optional depending on the install you have.

Step 3

In step 3 simply follow the normal procedure to install a multisite:

  • Add define(‘MULTISITE’, true); in wp-config.php
  • Reconnect to your admin
  • Go to tools > network
  • Follow the guide and choose the subdomains or paths parameter!

And you should now have a running multisite install !

Wait! Don’t do it now!

Wait, wait,w ait, don’t dont this procedure just right now. Before doing all this, and probably losing data, simply open wp-config.php and try to set define(‘SUBDOMAIN_INSTALL’, false); to “true” (or “false“, depending on what you want to do) and see if this works or not (you will probably have to make some modifications within the admin of each existing site).

Final thoughts

Well, i did these steps on an install where i was testing multisite features, and i wasn’t really using sub-sites, that means it wasn’t a problem to lose sub-sites data, but if you need to keep existing sites data, please try this on a separate server and test everything before doing it on the production server.

If you lose data, i can’t be responsible for that, and you are the only responsible of what you do, ok guys?

Leave a Reply