Changing Multisite URL after the subsite has been in use

This question is getting a little old, but since I came across it looking for other related things I thought it deserved an answer. The answer provided on that other link you included is actually the spot-on correct answer here too. It goes into more detail, but I will summarize here.

What you want to do is called domain mapping. A while ago in previous versions of WPMU / Multsite this had to be accomplished using a plugin. Now, it’s baked into the setting called “Site Address (URL)” for each subsite in Network Admin > Sites > Edit [site] > Info [tab]

Changing the Site Address (URL) of a subsite will not affect the main site URL or other subsite URLs. The thing to keep in mind is that WordPress controls serving content to those configured URLs, but it’s critical to make sure that DNS A Records are properly pointed to the server for any domains you want to map to subsites. All those domains will have the same IP address in DNS, and then once the requests for a particular domain / URL hits WordPress it will serve the correct content based on what is configured for Site Home and Site URL settings in the database.

Other than changes in DNS to point the domain to the right IP you do not need to do anything fancy with apache or reverse proxy.

Changing the Site Address (URL) setting of a subsite will not break anything on the site (assuming you have properly used relative URLs for everything). Note that some themes and plugins might store a static URL for some settings or images in the database, which will indeed break.

However, there is a very easy fix for that. Use a plugin like Better Search and Replace to easily find ALL entries of
site1.example.wordpress.org
and replace to
crafting-jewelry-1.com

Using the full domains you want to update there will only target things that should be replaced and this will happen across your database. There are different opinions on this, but when I’m doing a rename like this I also turn the option ON to replace GUIDs as well. However, you should understand the implications of doing that or just leave that option OFF.

Naturally, take good backups before doing any of this in case something does not go as expected.

In a nutshell:

  1. Make sure DNS is pointing the domain you want to use at the IP address where WP multisite is installed.
  2. Update the Site Address (URL) setting for the subsite you want to change
  3. Run Better Search and Replace on the old subsite domain to the new subsite domain (it’s default mode is a dry run which does not actually make changes but lets you see how many replacements it will make).

Additional, good details are here as referenced in the question:

How to use WordPress Multisite With Different Domain Names?

Leave a Comment