How do I configure WordPress to use the “Network of Sites” and “Domain Mapping” functionality?
Advanced users might want to use the WordPress “network of sites” (multisite) feature, possibly with the WordPress MU Domain Mapping plugin. This combination allows separate “sites” within one WordPress installation, possibly mapping different domain names or subdomains to those sites.
This page isn’t a full guide: it just has tips for our servers, and assumes you have a strong working knowledge of WordPress. See the official WordPress network of sites documentation for more detailed information.
We don’t recommend using the WordPress “network of sites” feature.
Before we go any further, we should first mention that we find this to be far too complicated and unreliable for most sites, and we don’t recommend using this feature of WordPress.
Customers who use the “network of sites” feature tend to experience far more problems than most WordPress users. In particular:
- It requires additional setup that’s not necessary with standard WordPress.
- Some plugins and themes don’t work properly with it.
- It changes the way WordPress handles images, leading to a more complex configuration that can be difficult to get working in some cases and uses far more CPU resources.
- If you use it to handle multiple domain names, it unnecessarily ties together those domain names in a technical sense, which limits what you can do. For example, you can’t have separate email addresses for the two domain names, and you can’t cancel the hosting service for the domain name that hosts the database and files without interrupting service for all of them.
- If your WordPress installation has problems or gets “hacked”, all your sites are down instead of just one. You also can’t easily troubleshoot problems with one of the sites without possibly affecting others.
- The added complexity and lighter testing it receives from developers leads to many reports of problems that are specific to multisite.
- Most WordPress experts (including our staff) have much less experience with multisite setups, making it harder to get help with problems. We can’t provide any support for issues related to WordPress multisite.
Unless you have a large number of sites, it’s usually far easier to simply set up a separate copy of WordPress for each domain name or subdomain. Our Add-On Hosting feature keeps the costs low for extra domain names, and you can set up folders containing separate copies of WordPress for subdomains.
If you choose to do it anyway, the rest of this page will help you set it up.
1. Turn on WordPress Multisite feature
To turn on the Multisite feature of WordPress, you will need to add this additional line to your “wp-config.php” file:
It should go right above the following comment:
/* That's all, stop editing! Happy blogging. */
After doing this, the two lines should look like this:
define('WP_ALLOW_MULTISITE', true); /* That's all, stop editing! Happy blogging. */
If your wp-config.php file doesn't have the “Thats all...” comment, place the new line above the first line that begins with “require” or “include”.
2. Set up Network of Sites
- Login to the WordPress dashboard.
- Choose Tools > Network Setup.
- Follow the instructions on screen exactly.
These instructions include creating a new directory for your blogs, plus specific instructions for new code to add to both “wp-config.php” and “.htacccess”. It is important that you follow these instructions exactly as shown on the screen. Once completed, you can install the optional domain mapping plugin.
3. Install domain mapping plugin
By default, the WordPress network will use different subdomains for the separate sites you create. Many users want to use entirely separate, unique domain names for these sites instead. This will require an extra plugin that lets you map additional domain names to your sites.
After installing and “Network Activating” the plugin, you will need to perform the following extra steps:
- Move the file “sunrise.php” from its location in “wp-content/plugins/wordpress-mu-domain-mapping” to the “wp-content” directory.
- Edit your “wp-config.php” file again and place the following line above the last “require_once” command:
define( 'SUNRISE', 'on' );
4. Configure domain mapping plugin
This section is very important as you can’t use the plugin to configure separate sites until you have completed the steps below:
- Make sure you are logged in as a “Super Admin” (any user with administrative access to your Main WordPress site).
- Choose Settings > Domain Mapping.
- Enter 0.0.0.0 for the IP address.
Some customers might wonder why they don’t enter the actual IP address of the server. Here’s why:
The WordPress MU Domain Mapping plugin doesn’t actually use the IP address you enter, except when it generates some instructions for setting up a DNS “A record” based on the IP address you type. Unfortunately, the plugin’s instructions about those DNS entries aren't correct for our servers (or the servers of many other “shared hosting” providers, for that matter). There are two problems with them:
- If you enter the “A record” IP address manually somewhere but our servers don’t know anything about the extra domain name you’re setting up, it won’t work at all. Our Apache Web servers won’t match the new domain name to your files and plugin. So each extra domain name needs to be set up in advance on our end.
- But once an extra domain name is set up on our end and using our DNS nameservers, you don’t need to enter the “A record” anywhere: our DNS servers automatically use the correct A record IP address for it, no matter what that IP address changes to. And in fact, entering the IP address manually somewhere is dangerous, because the “somewhere” won’t be automatically updated if the IP address ever changes. The extra domain names would then point to the wrong server and suddenly stop working. You can find more information on how we handle dedicated IP addresses.
So the long and short of it is that you don’t need to follow the IP address/DNS instructions that the plugin recommends. In fact, following them is actually harmful: it sets things up in a way that will probably break eventually. Just enter 0.0.0.0 and don’t worry about the IP address at all.
Your WordPress site is now “Network” enabled and has the ability to map separate domain names with the WordPress MU Domain Mapping plugin. To use an additional domain name with your new WordPress network, you will need to make sure it’s first set up in our system, using our DNS nameservers, and configured as a domain name alias to the domain name where you have installed WordPress.