How to set up WordPress Multisite on multiple domains without plugin?

It is important that you set the constant COOKIE_DOMAIN in the wp-config.php

define( 'COOKIE_DOMAIN', '' );

The value must be empty, otherwise WordPress will always set it to your network’s $current_site->domain and you won’t be able to login into any of the other sites.

From core:

/**
 * @since 2.0.0
 */
if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
   if ( !empty( $current_site->cookie_domain ) )
       define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
   else
       define('COOKIE_DOMAIN', '.' . $current_site->domain);
}

Now you can set a domain in the settings of each site in the network.

Sceenshot Settings

Leave a Comment