WordPress guides

How to install WordPress multisite and create a network of sites

Installing WordPress multisite and creating a network of sites

To install WordPress multisite, add define( 'WP_ALLOW_MULTISITE', true ); to wp-config.php, open Tools then Network Setup, choose subdomains or subdirectories, then paste the lines WordPress gives you into wp-config.php and .htaccess. A quarter of an hour is enough. The real question comes before that: a network shares everything (code, plugins, database, accounts), which makes management simpler but ties the fate of every site together. This guide helps you decide, then walks you through it step by step.

Multisite: what is shared and what isn’t

A multisite network is a single WordPress installation that serves several sites. Each site has its own content, settings and media; everything else is shared.

A multisite network: one installation, several sites In the centre, the shared installation: WordPress core, plugins, themes, database and accounts. Three sites hang off it, each with its own content, settings and media. An update made by the Super Admin reaches every site at once, just as a flaw in a network-activated plugin would. Shared installation core, plugins, themes database, accounts Super Admin Site 1example.comcontent, settings,media Site 2example.com/shopcontent, settings,media Site 3blog.example.comcontent, settings,media A multisite network: one installation, several sitesIn the centre, the shared installation: WordPress core, plugins, themes, database and accounts. Three sites hang off it, each with its own content, settings and media. An update made by the Super Admin reaches every site at once, just as a flaw in a network-activated plugin would.Shared installationcore, plugins, themesdatabase, accountsSuper AdminSite 1example.comcontent, settings, mediaSite 2example.com/shopcontent, settings, mediaSite 3blog.example.comcontent, settings, media
  • Shared: the WordPress files, the installed plugins and themes, the users table, the database (each site gets its own tables, prefixed wp_2_, wp_3_ and so on).
  • Specific to each site: posts, pages, settings, locally activated plugins, active theme, media stored in wp-content/uploads/sites/N/.
  • Reserved for the Super Admin: installing or deleting plugins and themes, creating sites, publishing unfiltered HTML. Each site’s administrators can only activate what the Super Admin has installed.

Pros, cons and risks

ProsCons and risks
One update for every siteAn update that breaks things breaks the whole network
Plugins and themes installed onceA flaw in a network plugin exposes every site
Shared accounts, one login for several sitesA compromised Super Admin account hands over every site
A new site in a few secondsRestoring a single site from a backup is trickier
Local administrators can’t install codeSome plugins don’t support multisite
Ideal for similar sites (franchises, schools, languages)A site that outgrows the network can’t leave it in one click

Choose multisite for a network of similar sites run by the same team: regional branches, schools, one site per language, blogging platforms. Avoid it for sites belonging to different clients, very different sites, or a store that needs specific plugins: separate installations, managed with a central monitoring tool, isolate risks better.

Subdomains or subdirectories?

CriterionSubdomainsSubdirectories
Site addressesblog.example.comexample.com/blog
DNSWildcard record *.example.com to create sites on the flyNothing to add
HTTPSWildcard certificate or one certificate per subdomainThe domain’s certificate is enough
Possible if…Not on localhost or an IP addressSite installed less than a month ago, otherwise blocked by default
SEOEach site is seen as more independentSites benefit more from the main domain

Either way, each site can later get its own domain name (see below).

Installing the network step by step

The six steps to create a multisite network: prepare (backup, permalinks, plugins deactivated), allow multisite in wp-config.php, create the network from Tools > Network Setup, paste the constants into wp-config.php, replace the .htaccess rules, then log back in and configure the network.

1. Prepare

Back up your files and database (the 3-2-1 rule), check that permalinks work and deactivate all plugins. If the site is already live, do it on a staging site first.

2. Allow multisite

In wp-config.php, above the line “That’s all, stop editing! Happy publishing.”:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );

3. Create the network

Reload the dashboard, open Tools > Network Setup, choose subdomains or subdirectories, check the network title and the admin email address, then click Install. From the command line, wp core multisite-convert does the same thing (add --subdomains for subdomains).

4. Complete wp-config.php

WordPress shows the exact lines for your installation. For a subdirectory network on example.com, they look like this:

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', 'example.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

5. Replace the .htaccess rules

On Apache or LiteSpeed, replace the WordPress block in the .htaccess file with the one shown on screen. For subdirectories:

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

For subdomains, the three rules containing ([_0-9a-zA-Z-]+/)? become RewriteRule ^wp-admin$ wp-admin/ [R=301,L], RewriteRule ^(wp-(content|admin|includes).*) $1 [L] and RewriteRule ^(.*\.php)$ $1 [L]. On Nginx there is no .htaccess: the equivalent rules go in the server configuration.

6. Log back in and configure the network

Log in again: the My Sites > Network Admin menu appears. In Network Settings, decide who can create a site, which file types are allowed, the maximum upload file size (1,500 KB by default) and the space per site (100 MB by default). Then reactivate your plugins one at a time, choosing for each between network activation and site-by-site activation.

Giving each site its own domain name

Domain mapping has been built in since WordPress 4.5. Point the domain to the network’s server, install an HTTPS certificate for that domain, then, in Network Admin > Sites, edit the site and replace its address with the new domain. If logging in fails with a cookie error, the official documentation suggests adding define( 'COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] ); to wp-config.php. Each domain then has its own cookies: you have to log in on each one.

Plugins, backups and network security

  • Compatibility: before installing a plugin, look for an explicit mention of multisite in its documentation. Caching, backup, security and e-commerce plugins are the most sensitive.
  • Backups: back up the entire network (files and the full database). Check that your tool can restore a single site without overwriting the others, and test it.
  • Super Admins: as few as possible, with two-factor authentication and named accounts; give site managers the site Administrator role only (see roles and least privilege).
  • Network plugins: every network-activated plugin is attack surface for every site. Delete the ones you no longer use.
  • Login: protect wp-login.php and wp-admin at server level if your security plugin doesn’t support multisite (see protecting wp-admin at server level).

WP Feint and multisite

Let’s be clear: WP Feint does not support multisite. On a network, the free version stays inactive (masking, the custom login URL and XML-RPC blocking don’t apply) so as not to break anything, and Pro’s file address aliases and image protection refuse to activate. WP Feint is designed for single installations, one site per installation.

If you’re still torn between a network and several separate installations, this is one more argument for the latter when the sites belong to different clients: each site then gets its own protection, and Pro’s member area tracks updates for all your sites in one place. For a network, rely on a security plugin that explicitly supports multisite and on server rules.

Key takeaways

  • Multisite shares code, plugins, database and accounts: ideal for similar sites run by the same team.
  • Subdirectories if the site is less than a month old, otherwise subdomains with wildcard DNS and a wildcard certificate.
  • Four technical steps: WP_ALLOW_MULTISITE, Network Setup, the wp-config.php lines, the .htaccess rules.
  • A flaw or a bad update hits the whole network: few Super Admins, few plugins, tested backups.
  • WP Feint doesn’t support multisite: protect the network at server level.

Frequently asked questions

Can I turn an existing site into a multisite?

Yes, that’s actually the normal method: the existing site becomes the network’s main site. If posts were published more than a month ago, WordPress forces subdomains unless you define ALLOW_SUBDIRECTORY_INSTALL.

Does my shared hosting support multisite?

With subdirectories, almost always. With subdomains, you need to be able to create a wildcard DNS record and a suitable HTTPS certificate, which not every shared host allows: check with your host.

How do I move a site out of a multisite network?

There’s no button: you export its content and media to a new single installation, with the WordPress export tool or a migration plugin that supports multisite, then recreate its settings and plugins.

Is multisite more secure than separate sites?

It’s easier to keep up to date, but less compartmentalised: a flaw or a compromised Super Admin account affects every site. For independent sites, separate installations limit the damage better.

Several separate sites? Protect them all

For single WordPress installations, WP Feint hides WordPress and protects the login on each site, and Pro tracks updates and vulnerabilities for all your sites in your member area, with plans for 10 and 50 sites.

Sources

  • WordPress Developer Resources: Before You Create A Network (external link, opens in a new tab)
  • WordPress Developer Resources: Create A Network (external link, opens in a new tab)
  • WordPress Developer Resources: Multisite Domain Mapping (external link, opens in a new tab)
  • WP-CLI: wp core multisite-convert (external link, opens in a new tab)