How to Setup WordPress Multisite Domain Mapping

Updated on March 09, 2018

wordpress multisite domain mapping

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 set up domain mapping. By default, additional sites setup within your multisite network are created as either subdomains of the root site ( or subfolders (e.g. Naturally, these don’t look very good and so by implementing domain mapping, you can point a site to an external domain, such as To other visitors, this will then appear as a normal website.

WordPress Multisite Domain Mapping

When it comes to setting up WordPress multisite domain mapping you do have a few options. We are going to walk you through the entire Multisite setup here at Kinsta as this can sometimes be confusing. If you already WordPress Multisite up and running, feel free to skip to Step 6 to start mapping your new subsite domains. If you aren’t a Kinsta client, we recommend checking out these easy alternative options for domain mapping.

Below we will be setting up the following:

  • (main subsite)
  • (additional subsite)
  • (additional subsite)
  • (additional subsite)

Step 1 – Install WordPress Multisite

If you are doing a fresh installation of WordPress you can automatically configure WordPress multisite when you add a new site in MyKinsta. Simply select “This is a multisite installation” and the type of multisite: subdirectory or subdomain. In this example, we’ll be using the subdomain type.

Install WordPress multisite

Install WordPress multisite

If you already have a WordPress site and need to turn it into a multisite installation, you will need to configure these Multisite settings. Or you can reach out to the Kinsta support team for assistance.

Step 2 – Add Domain to MyKinsta Dashboard and Point DNS

The next thing to do is add your main subsite domain to the MyKinsta dashboard. Click on your website and under the domains section click on “Add domain.” In this case, we add the following:

  • (set this as our primary domain)

This creates the necessary DNS records on our end. You must ensure that you then point your new domain to Kinsta. This includes pointing an A record for the domain and adding a CNAME for the www subdomain.

Add domain multisite mapping

Add domain multisite mapping

Step 3 – Update Main Network Admin Site

After installing your WordPress multisite you will then need to update the main subsite WordPress address URL. Why? Because by default it will have the temporary Kinsta URL. This is not editable in the WordPress dashboard, so the easiest way to do this is using the Kinsta search and replace tool.

WordPress multisite main subsite address URL

WordPress multisite main subsite address URL

In this example, we are going to run a search and replace on and replace it with our live domain: We recommend taking a backup before doing this.

In the search and replace tool, proceed with the following:

  1. Enter in the search field the value you want to search for in the database, which in this case is our temporary Kinsta URL:
  2. Enter in the replace field the new value that should be used to replace the value that you are searching for. In this case, its our live domain:
  3. Then click “Replace.”
Search and replace multisite

Search and replace multisite

An alternative to the above would be to update the following database tables manually via phpmyadmin.

  • wp_options: options named “siteurl” and “home”
  • wp_site
  • wp_sitemeta: the option named “siteurl”
  • wp_blogs: any entries in the “domains” column that have the old domain name
  • wp_#_options: Each subsite will have sets of tables that correspond to the blog_id in the wp_blogs table. Go to the wp_#_options table, where # corresponds to the blog_id, and update the “siteurl” and “home” settings in that table.

Step 4 – Update wp-config.php File

The next step is to update your wp-config.php file and add/update a few variables. The wp-config.php file is typically located at the root of your WordPress site and can be accessed via FTP, SSH, or WP-CLI.

  • Update 'DOMAIN-CURRENT_SITE' to your domain name (by default this will have the Kinsta temporary URL on new installations)
  • Add the following code to make the logins work properly:
Multisite variables in wp-config.php

Multisite variables in wp-config.php

Step 5 – Create New Subsite Installs

You can then create new subsite installs. Log in 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.

Multisite - create subsite install

Multisite – create subsite install

Step 6 – Map Domains To New Subsite Installs

Now that you have your new subsite setup, you need to map the external domain to it. As of WordPress 4.5, they no longer require a plugin to map domains. Simply click into edit from your “All Sites” list and it should look something like this below.

Multisite edit subsite

Update the Site Address (URL) field with the domain you are mapping it to.

Change subsite address URL

Change subsite address URL

You can then repeat the above steps for any additional subsites.

Multisite subsites

Multisite subsites

Step 7 – Add Subsite Domains to MyKinsta and Point DNS

You will then need to repeat step 2 above and add any additional subsite domains to MyKinsta. Click into your website and under the domains section click on “Add domain.”  In this case, we add the following:


This creates the necessary DNS records on our end. You must ensure that you then point your new domain to Kinsta. This includes pointing an A record for the domain and adding a CNAME for the www subdomain.

Subsite domains

Subsite domains

Alternate Options

There are a few other options for setting up WordPress multisite domain mapping as well, although we recommend using the method above.

1. WordPress MU Domain Mapping Plugin

If you want to use a plugin, one of the easiest ways is the free WordPress MU Domain Mapping plugin from the team over at Automattic. 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 wordpress multisite domain mapping

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.

sunrise multisite mapping file


Then in your wp-config.php file, you need to define it. So add the following code:

define( 'SUNRISE', 'on' );
sunrise wp-config file

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.

multisite ID

Multisite ID

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

Domain mapping to ID

And don’t forget to point your new domain to Kinsta.

2. 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 Mercator-master to mercator.

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 wp-config.php:

define('SUNRISE', true);

3. 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.

Was this article helpful?
No, or there was something off

Hand-picked related articles

Use WordPress?

Join 20,000+ others who get our FREE weekly newsletter with WordPress tips on how to drive more traffic and revenue to your business!

You have Successfully Subscribed!

Send this to a friend