Multisite Domain Mapping in WordPress

WordPress Multisite Domain Mapping — is a technology that allows assigning fully unique domain names (for example, site1.com) to individual sites within a WordPress Multisite network instead of using subdomains (site1.coolnetwork.com) or subdirectories (coolnetwork.com/site1).

Despite having different domains, all sites continue to run on one WordPress installation, which significantly simplifies administration. For visitors the sites will look like completely independent resources.

Since WP 4.5, Domain Mapping is a native feature of WordPress! That is, no plugins are needed!

This feature can be useful in various scenarios, for example:

  • Managing client sites: Freelancers can consolidate client sites into one network to simplify updates and maintenance.

  • Multilingual sites: Using localized domains for different countries (for example, .es, .de, .co.uk).

  • Website-as-a-Service (WaaS): Allows users to create their own sites on your platform using their personal domains (as on WordPress.com).

  • Corporate branding: Large enterprises can create separate sites for different products (for example, iphone.com and macbook.com), managing them from a single dashboard.

Instruction to enable mapping

Step 1: Prepare the Multisite network

Make sure your WordPress Multisite network is properly configured and working without errors. You should be able to create new sites in subdirectories or on subdomains before attaching unique domains to them.

Step 2: DNS configuration

Your new unique domain must point to the server where WordPress is installed. You will need to configure DNS records at the domain registrar:

  • A record: Points the domain to the IP address of your server.
  • CNAME: Used to map subdomains (for example, www) to the main domain.

Step 3: Add the domain in hosting

You need to add the new domain in the hosting control panel (for example, cPanel) as an Alias or Parked Domain. This will allow the server to understand which content to show when the new address is requested.

Step 4: Bind the domain in WordPress admin

  1. Go to Network Admin > Sites.
  2. Click “Edit” under the desired site.
  3. In the “Site Address (URL)” (Site Address) field enter the full address of the new domain, including the protocol (for example, https://example.com).
  4. Save the changes.

Important technical nuances

SSL certificates

For security and SEO it is critically important to install SSL certificates for all attached domains. It is recommended to use SNI (Server Name Indication) technology to support multiple certificates on one IP address.

Fixing login error (Cookies)

One common problem is cookie blocking when trying to log into the admin of the mapped site. To solve it add the following line to the wp-config.php file after the network activation code:

define( 'COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );

This will allow WordPress to correctly handle cookies for different domain names within a single network.

--

Sources: