The most powerful feature of WordPress is the ability to have multiple sites under one parent WordPress Multisite environment. This tutorial will help you add new sites to your WordPress Multisite environment and map a custom domain to the new site.
Create A Subsite
- Map your multisite’s primary domain
- Subdomain multisite networks only, (EX: subsite.domain.com), add your new subdomain to the User Portal
- Create the subsite within your WordPress Multisite website:
- Open your websites wp-admin
- Navigate to My Sites > Sites (/wp-admin/network/sites.php)
- Click Add New at the top
- Fill out all fields:
- Site Address — Never use “www”
- Subdomain: siteaddress.yourdomain.com
- Subdirectory: yourdomain.com/siteaddress
- Site Title — Title of the site, can be changed later
- Admin Email — Set as the initial admin user for the subsite
- Site Address — Never use “www”
Map a Custom Domain to a Subsite
You can also map a custom domain to a subsite, allowing it to be accessed at a completely different URL than the Primary Domain.
For example, subsite.domain.com or domain.com/subsite could be accessed as mytotallynewsite.com
Before proceeding make sure you have:
Native Domain Mapping
In WordPress 4.5, Native Domain Mapping was added to WordPress core. This removes the need for a plugin to map your custom domains to a subsite. This is the recommended method for new multisites and multisites that are not already using the MU Domain Mapping method.
- Open your multisite’s Network Admin
- Open the Sites page
- Click Edit near the subsite you’re updating
- Change the Subsite Address (URL) to your new custom domain.
- Be sure to include http or https protocol:
WordPress MU Domain Mapping Plugin
This is no longer the recommended domain mapping method as it requires manual configuration and there is no benefit to using it over Native Mapping. For customers who are already using the WordPress MU Domain Mapping Plugin, it is possible to switch to using Native Domain Mapping also no benefit or reason to do so yet.
- Ensure the MU Domain Mapping plugin is installed and activated
- Using SFTP, move sunrise.php from the plugin directory into wp-content/
- Edit wp-config.php add: define( ‘SUNRISE’, ‘on’ );
- Open your multisite Network Admin
- Select Settings > Domain Mapping on left menu
- Fill in the Site ID for the subsite you are mapping
- You can find the Site ID from Network Admin > Sites, in the ID column
- Fill in the custom Domain for that subsite
NOTE: Do not define COOKIE_DOMAIN in your wp-config.php as it conflicts with logins on your mapped domains.
When adding subsites to a subdomain multisite, you’ll find that each new subdomain also needs to be added to the Domains section of your WP Engine User Portal. For just a few subdomains this process isn’t so bad, but it can become frustrating for users with a large number of subdomains.
We have an option called “Domain Wildcarding.” When enabled, any subdomain that may come before your root domain (ex. anything.domain.com) is automatically assigned to that Environment’s Domains section. Reach out to Support from your User Portal and we will be glad to enable this setting for you.
NOTE: If you converted to subdomain multisite using our conversion tool, this is already enabled when setting your network up.
SET DNS RECORDS
If you are using a custom domain as your multisite’s primary domain (ex. mycoolsite.com), subdomain subsites will be created as subdomains of that primary domain automatically (ex. subsite.domain.com).
For this reason, you will also need to ensure that a DNS record is set up with your DNS provider for each of your subdomains. We recommend setting this record as a wildcard CNAME record to your environment.wpengine.com domain, as outlined in our DNS Best Practices article. If you have questions regarding how to set up this record, we recommend contacting your DNS provider for further help.
NOTE: If you are using Let’s Encrypt certificates for each subdomain, you will need to add each subdomain manually to the Domains section of your User Portal. To avoid this, we recommend installing a wildcard SSL.
If you are using other subdomains of your multisite’s primary domain on separate WP Engine Environments, we do not recommend enabling Domain Wildcarding. Since Domain Wildcarding will assign all subdomains of your primary domain to your multisite Environment, you may run into configuration issues with the subdomains configured for other Environments.
If you plan to have a subdomain in use on another site, we do recommend adding each subdomain separately to the Domains section in the User Portal to ensure each is configured correctly.