Need to set up WordPress multisite domain mapping?
Domain mapping allows you to map completely unique domain names to different sites in your WordPress multisite network, which opens up a ton of opportunities for this feature. Since the debut of WordPress 4.5, the company offers multisite domain mapping as a core feature - there's no longer any need to use a separate plugin like WordPress MU Domain Mapping.
Even though this functionality is now available in the core software, it can still be a bit tricky to configure and use WordPress multisite domain mapping. This step-by-step WordPress multisite domain mapping tutorial will help streamline the process. Today, we’ll walk you through domain mapping and why it's useful. Then, we'll show you step-by-step how to set up domain mapping for WordPress multisite.
- What is domain mapping for WordPress multisite?
- What can you use WordPress multisite domain mapping for?
- How to Set Up WordPress Multisite Domain Mapping in Six Steps
What is domain mapping for WordPress multisite?
With WordPress multisite, you can create a network of sites all powered by the same WordPress install.
By default, these network sites use either subdomains or subdirectories of your main domain name. For example, if your main domain name is coolnetwork.com, then here's how the domains would be structured:
- Subdomains - site1.coolnetwork.com, site2.coolnetwork.com, site3.coolnetwork.com, etc.
- Subdirectories - coolnetwork.com/site1, coolnetwork.com/site2, coolnetwork.com/site3, etc.
With WordPress multisite domain mapping, also known as WordPress multisite domain alias mapping, you can map completely unique domain names to each site in your network instead of using subdomains or subdirectories. For example, site1.com, site2.com, site3.com.
And despite having separate domain names, each site would still be powered by the same single WordPress install.
Basically, you can have the appearance of having completely separate WordPress installs despite using WordPress multisite on the backend. This will have no impact on your website visitors’ user experience, either. They’ll view your websites as completely separate.
What can you use WordPress multisite domain mapping for?
WordPress multisite domain mapping can be useful in a ton of different situations. Here are some of the most prevalent examples:
- Multilingual website: You can use a separate localized domain name for each network site - e.g. yoursite.es, yoursite.de, yoursite.co.uk, etc.
- Website as a service (WaaS): You can create a service that lets people create their own sites. Because they can still use their own custom domain names, they can easily create custom-branded websites. WordPress.com is one of the most well-known examples here, but other WaaS businesses have used this same approach.
- Client websites: Some freelancers like to use this multisite approach for client sites, as it simplifies admin processes. However, it also limits your flexibility, so consider the pros and cons before using multisite networks for client websites.
Basically, you can use WordPress multisite domain mapping whenever your use case meets two criteria:
- You want to be able to power all of the websites from one single WordPress install (instead of creating a separate WordPress install for each website).
- Each website still needs to have its own unique domain name.
How to Set Up WordPress Multisite Domain Mapping in Six Steps
Here's a high-level look at how to setup domain mapping in WordPress multisite - keep reading for the full tutorial:
- Create your WordPress multisite install.
- Edit wp-config.php file to handle logins for domain mapping.
- Add network subsites.
- Edit network subsites' URLs to use custom domain names.
- Add custom domains as parked or alias domains at your host.
- Point custom domains to your host's nameservers.
1. Create Your WordPress Multisite Install
To get started, create your WordPress multisite install if you haven't done so already.
This is the base install that will power all of your network websites, even though they'll have unique domain names.
Many WordPress hosts now offer a multisite install option as part of their WordPress installers. If your host does, this is the easiest way to create your base WordPress multisite install as these preinstalled multisite networks work just fine for domain alias mapping.
Here's an example of the WordPress multisite install option on Kinsta:
If your web host doesn't offer a multisite install option, you can also manually create your multisite network. To begin, create a fresh single-site WordPress install, just like you'd normally install WordPress.
Then, you'll need to edit the wp-config.php file of your WordPress site and add the following line of code just above the "That's all, stop editing!" line:
Once you save the file, you can go to Tools → Network Setup in your WordPress dashboard to continue installing WordPress multisite.
Here, you can choose the URL approach for each network site - either Sub-directories or Sub-domains. Either approach is suitable, it simply depends on your preference. If you're going to be mapping unique domains to every network site, it doesn't really matter which you choose. But if you plan to have some network sites that aren't mapped to unique domain names, you'll want to choose the relevant approach.
Once you make your choice and click Install, WordPress will give you two pieces of code that you need to add to your site:
- Add one code snippet to your wp-config.php file.
- Add the other code snippet to your .htaccess file.
If you want to use subdomains, you'll also need to set up a wildcard entry in your domain's DNS settings.
2. Edit wp-config.php
Once you've set up your functioning WordPress multisite install, the next step is to add some additional code to your site's wp-config.php file.
While all of the previous code snippets that you added relate to WordPress multisite in general, this code snippet is focused on enabling WordPress multisite domain mapping.
More specifically, it will ensure that your login process works even across different domain names in your network.
Here's the code snippet:
We recommend adding it below the define('BLOG_ID_CURRENT_SITE', 1); line.
Here's what it should look like:
3. Create New Network Subsites
Now that you've set up your WordPress multisite network, you're ready to start adding your individual network sites.
When you first add each network site, you'll only be able to add it as a subdomain or subdirectory of your main network site. This is a quirk of the WordPress multisite system.
However, once you've added the site, you'll be able to go back and edit it to include the actual domain name that you want to use. We'll cover that in the next step.
To create a network site, open your network's admin dashboard, which you can access by going to My Sites → Network Admin.
Then, inside your network admin, go to Sites → Add New:
First, enter the Site Address (URL). Again, you cannot enter the separate domain name yet. Instead, just add some temporary information - it will follow the URL format of your network (subdomain or subdirectory).
Below that, you can add the Site Title, Site Language, and Admin Email.
Once you've entered all of the information, click the Add Site button:
4. Edit Network Subsite Domain Names
Once you've added your network subsites, it’s time to go back and update their domain names according to the domain mapping setup that you want to use.
Go to Sites → All Sites in your network admin. Then, click the Edit option under the network site that you want to map to a custom domain name.
Now, you should be able to fully edit the Site Address (URL) field to include the full link to the custom domain name that you want to use for this network site:
Once you've done that, make sure to click the Save Changes button.
You'll then repeat the same process for each network subsite.
Once you're finished, each network site should show its unique domain name when you go to Sites → All Sites in your network admin:
5. Add Subsite Domains to Hosting Dashboard
Next, it’s time to add your subsite domains to your hosting account.
Because the process you’ll follow to do this depends on your hosting provider, we can't share one set of instructions that will work in every situation.
In general, you'll want to look for terms like Parked Domain or Alias Domain when adding your domain names. However, at some hosts, you'll just add the domains via the regular Domains interface.
Here's how it works at a few different popular hosting providers/control panels…
Kinsta
If you're hosting with Kinsta, you can add all of your domain aliases by going to the Domains area in your site's dashboard in the MyKinsta dashboard.
cPanel
If you’re using cPanel, locate a Parked Domains tool under the Domains section of your cPanel dashboard.
In some situations, you also might see this referred to as Aliases instead of Parked Domains. Or, in some recent cPanel interfaces, everything is available under the Domains interface instead of having a separate interface for parked/alias domains.
Once you've found the proper interface, go through and add each domain name that you want to map to your multisite install.
At some hosts, cPanel will automatically set up a redirection rule to your main domain name when you add an alias/parked domain. You'll typically see this appear in the Redirects To column.
If your host does automatically add a redirection rule, you'll need to go in and manually disable that. Otherwise, this alias domain will redirect to your main domain name instead of showing the network site.
SiteGround Site Tools
If you're using SiteGround, you'll manage your hosting via SiteGround's custom Site Tools dashboard.
If you go into the dashboard for your main multisite install, you should see a Parked Domains option under the Domain menu.
6. Update Domains to Point to Host's Nameservers
You’re almost there. To finish things out, it’s necessary to point all of your alias domains to your host's nameservers if you haven't done so already.
You'll need to do this wherever you purchased your domains from. Here are links to tutorials from popular domain registrars:
Each domain name should have the same nameservers - you'll use the same nameservers for your network's main domain name and you can follow your host's instructions for pointing the domain names to your hosting.
Once you update the nameservers, it may take up to 24 hours for the DNS changes to take effect (but usually it's a lot faster than that).
And that's it! When you visit one of those domains, you should now see the associated WordPress multisite network site.
Congratulations — you just learned how to set up domain mapping in WordPress multisite.
Get Started With WordPress Multisite Domain Mapping Today
With WordPress multisite domain mapping, you can link a custom domain name to one or more sites in your WordPress multisite network.Even though each network site will have its own unique domain name, all of the sites will still be powered by the same WordPress multisite install.
This opens up a lot of flexibility and convenience, while still letting you give each network site its own branding. Give it a try today and you can be up and running with your own WordPress multisite network in no time.