The Complete Guide to WordPress Multisite Domain Mapping in 2024
Are you looking to create a network of sites with WordPress multisite but want each site to have its own unique domain name? Domain mapping is the answer.
With WordPress multisite domain mapping, you can map completely custom domain names to sites in your network, allowing you to create a network of sites that are connected on the back-end but appear totally separate to visitors. This opens up endless possibilities for building and managing a WordPress site network.
In this comprehensive guide, we‘ll dive deep into what WordPress multisite domain mapping is, why it‘s beneficial, and how to set it up on your own multisite network, step-by-step. By the end, you‘ll be ready to harness the power of domain mapping for your projects. Let‘s get started!
WordPress Multisite and Domain Mapping: The Basics
Before we jump into the how-to, let‘s cover some key background information to make sure we‘re all on the same page.
What is WordPress Multisite?
WordPress multisite is a feature of WordPress that allows you to create a network of sites, all running on a single WordPress installation. It‘s a powerful tool for anyone who needs to manage multiple sites, as it allows you to update the core software, plugins, and themes across all your sites from one central location.
Some key features of WordPress multisite:
- All sites share the same WordPress installation, plugins, and themes
- Sites can have unique content, settings, and admins
- Super admins can manage all sites and users from a central dashboard
- Ideal for managing a large number of sites efficiently
By default, sites in a multisite network have URLs that are either subdomains or subdirectories of the main domain. For example:
- Subdomains:
site1.network.com,site2.network.com, etc. - Subdirectories:
network.com/site1,network.com/site2, etc.
While this works fine, in many cases it‘s desirable for each site in the network to have its own unique, memorable, and brandable domain name. That‘s where WordPress multisite domain mapping comes in.
What is Domain Mapping?
Domain mapping is the process of mapping a fully custom domain name to a site in a multisite network. So instead of a site having a URL like site1.network.com, it can have its own domain like site1.com.
This allows each site to have a completely unique domain name while still being part of the multisite network and manageable from the central dashboard.
Some examples of when domain mapping is useful:
- Building a network of client sites for an agency, where each client needs their own domain
- Creating a network of sites on different (but related) topics, with domain names relevant to each topic
- Setting up a network of country-specific sites for a global brand, with localized domain names for each country (e.g.
brand.defor Germany,brand.frfor France, etc.) - Allowing users to sign up and create their own site on your network with a custom domain (like WordPress.com does)
The beauty of domain mapping is that it allows for complete flexibility and customization of your site network‘s URL structure and branding, while still retaining the convenience and efficiency of managing the network as a whole with WordPress multisite.
The Benefits of WordPress Multisite Domain Mapping
So why go through the trouble of setting up WordPress multisite and domain mapping? Here are some of the key benefits:
- Unique branding: Each site can have its own unique domain name, allowing for consistent branding.
- SEO benefits: Unique domains can be better for SEO than subdomains in many cases (more on this later).
- Memorable URLs: Custom domains are more memorable and professional than long subdomains or subdirectories.
- Central management: Despite the unique domains, you still get all the management benefits of WordPress multisite – central updates, user management, etc.
- Flexibility: Map as many or as few sites as you want, and use any domain names you wish.
- Scalability: As your network grows, domain mapping scales with you. No need to migrate sites to new installs.
In short, WordPress multisite domain mapping gives you the best of both worlds – the convenience of centralized WordPress multisite management, and the branding and SEO benefits of unique domain names.
Now that we‘ve covered the basics, let‘s dive into the step-by-step process of actually setting up WordPress multisite domain mapping.
How to Set Up WordPress Multisite Domain Mapping (Step-by-Step)
Setting up domain mapping on a WordPress multisite network involves several steps:
- Set up WordPress multisite
- Configure wildcard subdomains (optional)
- Install a domain mapping plugin
- Configure the domain mapping plugin
- Add new sites to your network
- Map domains to sites
- Configure DNS for mapped domains
We‘ll go through each of these in detail. While there are a number of steps involved, the process is fairly straightforward, and once set up, domain mapping will make managing your network much easier in the long run.
Step 1: Set Up WordPress Multisite
The first step is to set up a WordPress multisite network if you haven‘t already. If you already have a WordPress multisite network up and running, you can skip to step 2.
Setting up a multisite network involves a few steps:
-
Deactivate all plugins (you can reactivate them later).
-
Add the following line to your
wp-config.phpfile:define(‘WP_ALLOW_MULTISITE‘, true); -
Go to Tools → Network Setup in your WordPress admin area.
-
Follow the prompts to set up your network, choosing subdomains or subdirectories.
-
Add the provided code snippets to your
wp-config.phpand.htaccessfiles. -
Log in to your new network by visiting the provided URL.
That‘s it! You now have a basic WordPress multisite network up and running. For more detailed instructions, check out the WordPress Codex guide on creating a network.
Step 2: Configure Wildcard Subdomains (Optional)
If you chose subdomains in step 1 (i.e. site1.network.com), you‘ll need to configure wildcard subdomains for domain mapping to work properly. This step is not necessary if you chose subdirectories.
To set up wildcard subdomains:
- Log in to your server or hosting control panel.
- Locate the option to manage DNS records for your domain.
- Add a new A record with the following settings:
- Host:
*(an asterisk) - Points to: The IP address of your server
- Host:
- Save the new record.
This wildcard DNS record will direct all subdomains to your server, which is necessary for domain mapping to work.
Step 3: Install a Domain Mapping Plugin
To make domain mapping easier, we‘ll use a plugin. There are a few options available, but for this guide we‘ll use the free WordPress MU Domain Mapping plugin.
To install the plugin:
- Download the plugin from the WordPress.org plugin repository.
- Go to Plugins → Add New in your network admin dashboard.
- Click the Upload Plugin button and select the plugin zip file.
- Click Install Now, then Activate.
The plugin is now installed and activated on your network.
Step 4: Configure the Domain Mapping Plugin
Next, we need to configure a few settings for the domain mapping plugin.
Go to Settings → Domain Mapping in your network admin dashboard. Here you‘ll see a few options:
- Server IP Address: Enter the IP address of your server. This is necessary for domain mapping to work properly. If you‘re not sure what your server‘s IP address is, ask your hosting provider.
- Domain Options: Choose whether you want to use a top-level domain (TLD) or a subdomain of your main domain for mapped domains. For most cases, you‘ll want to choose TLD.
- Redirect to Mapped Domain: Choose whether to redirect all traffic to the mapped domain. This is generally recommended for the best user experience.
Fill out these options and click Save Changes.
Step 5: Add New Sites to Your Network
Now that domain mapping is set up, you can start adding new sites to your network. To do this:
- Go to Sites → Add New in your network admin dashboard.
- Enter a site address (subdomain or subdirectory), site title, and admin email.
- Click Add Site.
Repeat this process for each new site you want to add to your network. Note that at this stage, you‘ll use a subdomain or subdirectory URL – we‘ll map the custom domain in the next step.
Step 6: Map Domains to Sites
Now for the fun part – actually mapping domains to your network sites.
For each site you want to map a domain to:
- Register the domain name you want to use with a domain registrar (if you haven‘t already).
- Go to Sites → All Sites in your network admin dashboard and click on the site you want to map a domain to.
- Under Settings → Domain Mapping, enter the domain name you want to map in the "New domain" field.
- Click Add.
Repeat this process for each site you want to map a domain to.
Step 7: Configure DNS for Mapped Domains
The final step is to configure DNS for your mapped domains to point to your WordPress server.
For each mapped domain:
- Log in to your domain registrar‘s control panel.
- Locate the option to manage DNS records for the domain.
- Add a new A record with the following settings:
- Host:
@(or leave blank) - Points to: The IP address of your server (the same one you entered in the plugin settings)
- Host:
- Save the new record.
DNS changes can take up to 48 hours to propagate, but usually happen much faster. Once propagation is complete, visiting your mapped domain should load the corresponding site from your WordPress multisite network.
Congratulations, you‘ve now successfully set up domain mapping on your WordPress multisite network! But wait, there‘s more! Let‘s cover some additional considerations.
Additional Considerations for WordPress Multisite Domain Mapping
While the basic setup process for domain mapping is fairly straightforward, there are a few additional things to keep in mind to ensure everything works smoothly.
Domain Mapping and SEO
One common question about domain mapping is how it impacts SEO. After all, one of the main benefits of domain mapping is the ability to use unique, relevant domain names for your sites, which can be beneficial for SEO.
The good news is that domain mapping, when set up properly, is perfectly fine for SEO. Google and other search engines will treat each mapped domain as a separate site, and any links and authority built to the mapped domain will be credited to that site.
However, there are a few best practices to keep in mind:
- Make sure each mapped domain has its own unique content. Don‘t just duplicate content across multiple domains, as this can be seen as spammy by search engines.
- Set up each mapped domain as its own property in Google Search Console and other webmaster tools, so you can monitor site health and performance.
- Avoid mapping multiple domains to the same site, as this can be seen as a manipulative tactic. Stick to one main domain per site.
Follow these guidelines and domain mapping can be a great tool for building a network of sites with SEO-friendly, unique domain names.
Cookies and Domain Mapping
Another consideration with domain mapping is how it impacts cookies. Cookies are small pieces of data stored by websites in a user‘s browser, used for things like user authentication and tracking.
By default, cookies are tied to the domain they were set on. This means that if a user logs in on one domain, they won‘t be automatically logged in on other mapped domains, even though they‘re all part of the same WordPress multisite network.
To fix this, you need to configure your WordPress installation to use cookies across all mapped domains. This is done by adding the following line to your wp-config.php file:
define(‘COOKIE_DOMAIN‘, $_SERVER[‘HTTP_HOST‘]);
This sets the cookie domain to the current domain being visited, allowing cookies to be shared across all mapped domains.
File Paths and Domain Mapping
A final consideration is how domain mapping impacts file paths in your WordPress installation.
By default, WordPress uses absolute file paths (e.g. /var/www/html/wp-content/uploads) to refer to files and directories. However, with domain mapping, each site needs to use the appropriate file path for its mapped domain.
The domain mapping plugin handles this by automatically rewriting file paths to use the appropriate mapped domain. However, in some cases you may need to manually update file paths, particularly in custom plugins or themes.
If you run into issues with file paths, check the domain mapping plugin‘s documentation for guidance on how to update them for compatibility with domain mapping.
Troubleshooting Common WordPress Multisite Domain Mapping Issues
While domain mapping is generally straightforward to set up, there are a few common issues that can arise. Here are some troubleshooting tips:
Mapped Domain Not Loading
If your mapped domain isn‘t loading at all, there are a few things to check:
- Make sure the domain is properly mapped in the domain mapping plugin‘s settings.
- Check that the DNS A record for the domain is pointing to the correct IP address for your server.
- Clear your browser‘s cache and cookies, as sometimes old cached versions of the site can cause issues.
- Check your server‘s error logs for any clues as to what might be going wrong.
Mapped Domain Loading with "Too Many Redirects" Error
If your mapped domain loads but you see a "too many redirects" error, this usually means there‘s an issue with the cookie configuration.
Make sure you‘ve added the COOKIE_DOMAIN line to your wp-config.php file as described above. If you‘ve done that and are still seeing the error, try clearing your browser‘s cookies and cache.
Mapped Domain Loading Main Site Instead of Subsite
If your mapped domain loads the main site of your network instead of the intended subsite, this usually means the domain hasn‘t been properly mapped in the domain mapping plugin‘s settings.
Double-check that the domain is listed in the plugin‘s settings for the correct subsite. Also make sure that the "Redirect to Mapped Domain" option is enabled in the plugin‘s settings.
404 Errors on Mapped Domain
If you‘re seeing 404 errors when trying to access pages on your mapped domain, this usually indicates an issue with your WordPress permalink settings.
Go to Settings → Permalinks in your network admin dashboard and click the Save Changes button to flush the permalink rewrite rules. This will regenerate the rewrite rules to include your mapped domains.
If you‘re still seeing 404 errors after flushing permalinks, check that your server‘s rewrite rules are configured correctly. The domain mapping plugin‘s documentation has more details on this.
Conclusion and Additional Resources
WordPress multisite domain mapping is a powerful tool for anyone managing a network of WordPress sites. It allows you to use unique, custom domain names for each site in your network while still retaining the convenience and efficiency of centralized WordPress multisite management.
In this guide, we‘ve covered everything you need to know to set up domain mapping on your own WordPress multisite network, including:
- What WordPress multisite is and how it works
- The benefits of using domain mapping with WordPress multisite
- A step-by-step walkthrough of setting up WordPress multisite and configuring domain mapping
- Additional considerations for SEO, cookies, and file paths
- Common issues and troubleshooting tips
While there are a number of steps involved in setting up domain mapping, the benefits are well worth it. With domain mapping, you can:
- Create a network of sites with unique, brandable domain names
- Improve the SEO of your network sites with keyword-rich domain names
- Provide a better user experience with memorable, easy-to-type domain names
- Centrally manage your entire network from a single WordPress dashboard
To learn more about WordPress multisite and domain mapping, check out these additional resources:
- The official WordPress Codex guide on creating a network
- The WordPress MU Domain Mapping plugin documentation
- The WordPress support forums on multisite and domain mapping
Happy domain mapping!
