Multisite is a great way to manage all your WordPress sites from a single installation. However, a very common issue that WordPress multisite administrators face is how to setup domain mapping. By default, additional sites setup within your multisite network are created as either subdomains of the root site (e.g.
subsite.network.com) or subfolders (e.g.
network.com/subsite). Naturally these don’t look very good and so by implementing domain mapping you can point a site to an external domain, such as domain.com. To other visitors, this will then appear as a normal website.
WordPress Multisite Domain Mapping
When it comes to setting up WordPress multsite domain mapping you do have a few options as we will dive into below. Some of the steps in this tutorial assume you are hosting your WordPress site with Kinsta; however most of the steps are applicable for anyone.
Step 1 – Add the Domain to Your My Kinsta Dashboard
The very first thing you need to do is add your domain within the My Kinsta dashboard. Click into your main multisite website and under the domains section click on “Add domain.” This creates the necessary DNS records on our end. You must ensure that you then point your new domain to Kinsta.
add domain multisite mapping
If you aren’t hosting with Kinsta, simply make sure to add the DNS records for your site with your web host.
Step 2 – Create New Multisite Install
The second step is to create your new multisite install. To do this you will want to login as the network admin and click on “Add New” under sites in your dashboard. You will then be prompted to choose a new site address, title, language, and admin email. Do not include www or .com in your site address. This should be something short and will be used internally.
Create Multisite install
After you create the multisite install you can click into edit and it should look something like this below.
Multisite edit site
Step 3 – Map a Domain To your New Install
Now that you have your new multisite setup, you need to map the external domain to it. As of WordPress 4.5, they no longer require a plugin to map domains. However, this requires a dedicated IP which we currently don’t provide at Kinsta.
So the easiest way to configure this is still by using a free plugin. We recommend WordPress MU Domain Mapping from the team over at Automatic. You can download it from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins. You will then need to “Network Activate” the plugin while you are logged in as the network admin.
Network activate plugin on Multisite
The plugin installs a file, sunrise.php, which you will need to move from within /wp-content/plugins/wordpress-mu-domain-mapping/ into the root of your /wp-content/ folder.
Then in your wp-config.php file, you need to define it. So add the following code:
define( 'SUNRISE', 'on' );
Configure sunrise in wp-config.php file
You then need to grab the site ID. Go to your list of sites and hover over “edit” on the install you just created. You can then see the site ID in your browser’s status bar at the bottom.
Take your site ID and enter it on the “Domains” page under settings. Ensure that the primary box is checked. This will then map that side ID to the domain.
Domain mapping to ID
And don’t forget to point your new domain to Kinsta.
There are a few other options for setting up WordPress multisite domain mapping as well.
1. Human Made Mercator Plugin
The Human Made team developed the free Mercator plugin to help make setting up domain mapping for multisite easier. It requires WordPress 3.9 or newer for the new sunrise processes. The setup is fairly similiar to the tutorial we walked you through above. They recommend dropping the Mercator’s directory into your
mu-plugins directory. You may need to rename the folder from
Then create a
wp-content/sunrise.php file with the following:
// Default mu-plugins directory if you haven't set it
defined( 'WPMU_PLUGIN_DIR' ) or define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' );
require WPMU_PLUGIN_DIR . '/mercator/mercator.php';
Additionally, in order for
sunrise.php to be loaded, you must add the following to your
2. WPMU Dev Domain Mapping Plugin
And last but not least, the team over at WPMU Dev also developed a premium Domain Mapping plugin. So if you already have a membership with them, you definitely want to check that out.