Multisite for WordPress

Multisite for WordPress® is a powerful WordPress feature that allows multiple subsites to share a database and site assets (like plugins, themes, and WordPress core files) with a main site.1 Multisite can be powerful when used correctly, but may require more involved set up or maintenance than you’re used to. In this guide we’ll discuss when and when not to use a multisite, how to use multisite with WP Engine hosting, and how to deploy a multisite.

Multisite is included with Premium plans. Shared plans, Growth and above, can purchase the multisite product extension from the Modify Plan page. Multisite cannot be purchased for Lite or Startup plans. Learn more about purchasing product extensions.

Enable Multisite

For the multisite to function as intended on WP Engine, you must have the multisite product extension and the environment must be converted to multisite in the User Portal. This setting in the User Portal impacts domain routing and SSL and should not be skipped. This is the recommended method when converting to a multisite network on WP Engine.

NOTE

Multisite is not supported on Lite or Startup plans. The multisite product extension can be purchased for Shared plans Growth and above, and is included with Premium plans. Learn more here.

Use the following steps to convert a WordPress environment to either a subdomain or a subdirectory multisite network:

  1. From the Sites page, click the environment name
  2. From the Advanced menu, select Utilities
  3. Under Multisite, select Convert to Multisite
  4. Select your multisite type and click Convert Environment
  • Sub-domain network: site1.example.com, site2.example.com, etc
  • Sub-directory network: example.com/site1, example.com/site2, etc

Disable Multisite

If you wish to convert a multisite back to a single site, use this method in the User Portal. This process will allow you to keep or discard multisite tables and will ensure the site remains configured correctly as a single site on WP Engine.

  1. From the Sites page, click the environment name
  2. From the Advanced menu, select Utilities
  3. Under Multisite, select Convert to Single Site
  4. You’ll be prompted with “Would you like to delete multisite/sub-site database tables?
    • Delete Tables  — Deletes any database tables for subsites you’ve added to this network
    • Keep TablesKeeps any database tables for subsites you’ve added to this network
  5. Click Disable Multisite

About Multisite

Multisite for WordPress is a feature that allows you to create a “network” of subsites within a single instance of WordPress. This network shares a file system, database, and are typically variations of the same domain. There are two types of multisites: subdomain (EX: site.domain.com) and subdirectory (EX: domain.com/site). Administrators can also map custom domains to any of their existing subsites.

A multisite includes a new user level called Superadmin. An Administrator can have access to one or several subsites in the network, as assigned by a Super Admin. A Super Admin will have access to every site within the network by default, as well as the Network Admin settings.

Most multisite network-wide changes (such as enabling plugins or themes) are done through the Network Admin. To get to the Network Admin:

  1. Log in to any site on the multisite network with a Super Admin level user
  2. Click My Sites at the top left

If you do not see My Sites, you are either not logged in as a Super Admin level user, or your multisite network is not properly configured.

In a multisite, the database will be shared but there will be a numbered subset of tables for each subsite. Individual subsites can have their own users, plugins, and themes enabled specifically for them due to these separate, numbered tables.

Plugins and themes can only be installed or uninstalled from the Network Admin by Super Admin level users. Multisites will use the same directory for plugins and themes within the wp-content folder. Plugins and themes can then be set to Network Enable or Network Activate by a Super Admin.

Network Enable  — The plugin or theme can be turned on or off from each subsite’s wp-admin area.

Network Active — The plugin or theme is forced as active for all subsites. It cannot be disabled from any individual subsite’s admin area.


When to Use Multisite

There are several reasons you may want to use Multisite.

  • All sites within the multisite network share the same WordPress core files, theme, and plugins, meaning updates only have to happen once each time, rather than logging into several individual sites.
  • Easy managing of subdomains of your root domain in one central dashboard.

When to Not Use Multisite

There are also reasons why you should choose to not use a multisite. Do not use a multisite:

  • If you are unsure if a multisite would be a good fit for your needs. When in doubt, stick with a single site.
  • If you manage multiple unrelated sites which do not use the same theme, plugins, or design scheme.
  • If you manage a single site.
  • If each of your sites has a strong level of customization.
  • If each of your sites use the same theme but with different custom functions added.
  • If you have not added the Multisite product extension to your Growth or Scale plan.

Custom Main Site Domain

Multisite is a powerful tool for hosting many WordPress websites under the same domain. The primary site in the network is called the parent, primary, or main site. The main site can load under a custom domain name. Newly created subsites will also use this domain, either as a subdomain or subdirectory, depending on the type of network.

Mapping a custom domain to the main site in a multisite requires the following steps:

  1. Confirm the environment has been converted to multisite in the User Portal
  2. Add the new domain to the User Portal
  3. Point DNS for the domain
  4. Map the new domain to the main site in WordPress (detailed below)

When these steps have been completed, the domain will route traffic to the main site and be secured with SSL. Additional SSL (such as a wildcard SSL) can be added using this guide.

If there are issues with domain routing or SSL on the new domain, be sure the environment has been converted to a multisite in the User Portal. This setting will impact network routing, and must be enabled to ensure the network functions as expected.

WordPress Main Site Domain Mapping

Changing the primary domain of a multisite requires updates in several locations. The two primary steps to update a main site domain are: Update the database and update the wp-config.php file.

You will need access to the database and SFTP, or SSH Gateway before proceeding.

Update Database

Updating a multisite domain begins in the database of the website. Be sure to consistently use the same version of your domain, and not switch the spelling or change between www/non-www.

We recommend using the non-www variation (EX: domain.com) instead of the www version (EX: www.domain.com) to ensure your subsites write their dependent URLs correctly.

NOTE

If your site uses a custom database prefix, this will impact the table names listed below. If this is the case then replace wp_ with your prefix in the following table names, or change your database prefix.

  1. Open phpMyAdmin to view the database. If you’re not sure how to open the database, review our guide here.
    • These steps use phpMyAdmin, but this process can also be done using SSH Gateway.
  2. On the left, click wp_yourenvironment
  3. Locate the wp_options table in list and click on it to open
  4. Find the option name and double click on the the option value next to it:
    • siteurl
    • This option should use the protocol, either http or https. EX: http://newdomain.com
  5. Hit the ENTER or RETURN key to save the change
  6. Find the option name and double click on the the option value next to it:
    • home
    • This option should use the protocol, either http or https and exactly match the domain used previously. EX: http://newdomain.com
  7. Hit the ENTER or RETURN key to save the change
  1. On the far left, click on the table called wp_site
  2. Double click on the the domain value
  3. Update this to your domain name without http/https protocol. EX: newdomain.com
  4. Hit the ENTER or RETURN key to save the change
  1. On the far left, click on the table name wp_sitemeta
  2. Locate the following meta key and click the meta value next to it
    • siteurl
    • This option should use the protocol (http or https) and exactly match the domain used previously. It should include a trailing slash / at the very end. EX: http://newdomain.com/
  1. On the far left, click on the table name wp_blogs
  2. If you have already added subsites you may see several rows here. Each value in the domain column should have its domain updated to reference your new domain. Do not include protocol (http/https) here.
    • Subdirectory multisite: The domain column should simply list your old domain through any the rows. Update all rows to your new domain.
      • EX: coolsite.wpengine.com would become newdomain.com
    • Subdomain multisite: The domain column will show several subdomains of your old domain. Keep the subdomain and simply append it to your new domain instead.
      • EX 1: coolsite.wpengine.com would become newdomain.com and newsite.coolsite.wpengine.com would become newsite.newdomain.com.
      • EX 2: oldsite.com would become newdomain.com, and newsite.oldsite.com would become newsite.newdomain.com

NOTE

The next database changes are required only if you have already added subsites. Skip to the next section if you have not yet added any subsites.

  1. Each subsite has a set of database tables with a specific number added to the prefix. There may be several tables, it will vary by how many subsites you’ve already added.
  2. On the far left open each additional wp_#_options table
  3. Update the following option values:
    • siteurl
    • home
    • These should include http/https protocol.
List of Database Locations

If you’re comfortable with the database and simply need a brief list of the locations, they are found here. We’ve also noted where the http or https protocol should be included.

TableOptionProtocol?Notes
wp_optionshomeYes
wp_optionssiteurlYes
wp_sitedomainNo
wp_sitemetasiteurlYesInclude trailing slash
wp_blogsdomainNoUpdate all rows
wp_#_optionssiteurlYesUpdate all # options tables
wp_#_optionshomeYesUpdate all # options tables

Be sure to also update the wp-config.php file as detailed below.


Update wp-config.php

The last step requires modifying the WordPress configuration file on your website.

  1. Connect to your site using SFTP or SSH Gateway
  2. Download the wp-config.php file, located in your site’s root directory
  3. Update the following line to use your Primary Domain:
    • define( 'DOMAIN_CURRENT_SITE', 'newdomain.com' );
    • Do not include http/https protocol here.
  4. Save and upload the modified file, overwriting the original.

If you see the following lines, delete them. They will overwrite your database defines in some areas and will cause issues:

define( 'WP_HOME', 'http://somedomain.com' );
define( 'WP_SITEURL', 'http://somedomain.com' );

Custom Subsite Domain

The most powerful feature of multisite for WordPress is the ability to have multiple sites under one parent network multisite environment. The primary site in the network is called the parent, primary, or main site. Additional sites in the network are called subsites.

A custom domain can be mapped to a subsite, allowing it to be accessed at a completely different URL than the main site’s domain. For example, subsite.domain.com or domain.com/subsite could be accessed as mytotallynewsite.com

Mapping a custom domain to a subsite in a multisite requires the following steps:

  1. Confirm the environment has been converted to multisite in the User Portal
  2. Add the new domain to the User Portal
    • Each domain that will be mapped to a subsite should be added to the User Portal.
  3. Point DNS for the subsite domain
    • At this time only Advanced Network is supported for subsite domains.
    • DNS can be pointed using CNAME records (recommended), A records, or a wildcard CNAME record.
  4. Map the new domain to the subsite in WordPress (detailed below)

When these steps have been completed, the domain will route traffic to the specified subsite and be secured with SSL. Additional SSL (such as a wildcard SSL) can be added using this guide.

If there are issues with domain routing or SSL on the new domain, be sure the environment has been converted to a multisite in the User Portal. This setting will impact network routing, and must be enabled to ensure the network functions as expected.

WordPress Subsite Domain Mapping

In WordPress 4.5, Native Domain Mapping was added to WordPress core. This removes the need for a plugin to map a custom domain to a subsite. This is the recommended method for a new multisite and a multisite that is not already using the legacy MU Domain Mapping method.

  1. Open the multisite’s Network Admin
  2. Open the Sites page
  3. Click Edit near the subsite to be updated
  4. Change the Subsite Address (URL) to the new domain.
    • Be sure to include http or https protocol:

Multisite Deployment Best Practices

When deploying a multisite using the Copy Environment tool, a search and replace is performed to ensure main and subsite URLs are updated appropriately. In this article we discuss the best practices when copying a multisite network to ensure all URLs are updated correctly.

NOTE

This article refers to copying/deploying a multisite network using the WP Engine Copy Environment tool.

When the database is included in the Copy Environment process, a search and replace is run automatically to update URLs for the main site (the first site in the network) and any subsites to ensure they load correctly. It’s important to ensure your domain is configured correctly in both the WP Engine User Portal and the WordPress settings prior to initiating the deployment. To review the multisite domain configuration steps, see our guide.

  • When using custom domains, it’s recommended to use the non-www version of URLs. For example, domain.com and not www.domain.com. This applies to both the main site and any subsites.
  • Finally, we recommend mapping custom subsite domains only using the native domain mapping settings (preferred) or the domain mapping plugin (legacy). If you are using some alternate domain mapping solution then it’s possible your URLs will not be updated as expected when using the Copy Environment function. In this case, URL updates may need to be performed manually on the target environment to avoid redirects or broken URLs.

Search and Replace

The Copy Environment tool will automatically replace both the main and subsite domains on the target multisite network. Learn more about the search and replace process here. The domain that will load on the target environment will vary slightly based on your specific multisite configuration.

A search and replace will look for the source environment’s main site domain and replace it with the target environment’s main site domain. The main site domain can either be the WP Engine default domain (example.wpengine.com), or it can be a custom domain (somedomain.com). For best results, we recommend using the non-www version (domain.com) as the main site domain, and not the www version (www.domain.com).

  • EX 1: sourcedomain.com to destinationdomain.com
  • EX 2: source.wpengine.com to destination.wpengine.com
  • EX 3: domain.com to destination.wpengine.com
  • EX 4: source.wpengine.com to destinationdomain.com

Subsite URLs will be searched and replaced in the same way: the domain is updated from source to target, and the subsite name is retained to maintain the subdomain or subdirectory formatting.

  • EX 1: site1.source.wpengine.com to site1.destination.wpengine.com
  • EX 2: source.wpengine.com/site1 to destination.wpengine.com/site1

If the subsites are using custom domains, the URL will be reformatted to include that custom domain. This main site domain will be updated as normal. Both subdirectory and subdomain subsites will have their custom domains rewritten as subdomains.

  • EX 1: sourcedomain.com to sourcedomain-com.destination.wpengine.com
  • EX 2: sourcedomain.com to sourcedomain-com.destinationdomain.com

Special Considerations

The amount of time the copy process will take depends on the size of the website: Larger websites will take longer to copy than smaller websites. We recommend performing a copy during a low traffic period and if you have an eCommerce website, it may be wise to also enable maintenance mode first.

There are certain situations where you may choose to include, exclude, or partially include the database in your deployment. When copying the database partially, you can choose to include or exclude specific tables. These considerations are detailed below.

To learn more about including, excluding, and partially including the database, see the full guide here.

If a database table exists on both the source and destination environments and is included in the copy, the table will be overwritten. We always recommend assessing which data is needed prior to copying an environment, and especially when deploying to a Production environment.

Domain Mapping Plugin (Legacy)

When using the legacy domain mapping plugin for custom subsite domains, our system will not copy the wp_domain_mapping and wp_domain_mapping_logins tables. These tables contain the information necessary to load the subsites over their assigned custom domains.

By excluding these tables automatically, only the unmapped subsite URLs will exist instead. These unmapped URLs will be searched and replaced as normal based on the examples above.

If you decide to run a partial database copy, these tables need to be included or excluded specifically based on the desired outcome.

eCommerce

All eCommerce websites include important “live” data (such as new orders) that you do not want to be overwritten. We advise particular caution when copying to Production environments for this reason.

The database can be excluded entirely, which would only replace the file system. Or, the database can be partially copied, which could include only store-related content such as posts.


Copy a Subsite to Another Site

Copying a subsite from one environment to another, such as separating a subsite into its own single-site environment, is not possible using the Copy Environment tool. This should be done using native WordPress import/export tool, or a third party tool instead.

  1. Login to the dashboard of the subsite you wish to migrate
  2. Select Tools
  3. Click Export
  4. Select All Content
  5. Click Download Export File
  6. Login to the dashboard of the target site
    • If you are migrating to another multisite, create a new subsite first
  7. Select Tools
  8. Click Import
  9. Select WordPress
  10. Click Choose File
  11. Select the file exported in Step 5
  12. Click Upload File and Import

These steps will migrate all posts, pages and media used within them however this does not migrate any themes or plugins. These will need to either be added again manually or by copying the plugin/theme directories over using SFTP or SSH Gateway


NEXT STEP: Change the multisite primary domain

Still need help? Contact support.

We offer support 24 hours a day, 7 days a week, 365 days a year. Log in to your account to get expert one-on-one help.

The best hosting for WordPress

See why more customers prefer WP Engine over the competition.