Type something to search...
How to set up WordPress Multisite?

How to set up WordPress Multisite?

To set up WordPress Multisite, back up your site, add define( 'WP_ALLOW_MULTISITE', true ); to wp-config.php, then go to Tools > Network Setup, choose subdomains or subdirectories, and click Install. WordPress then gives you a block of code for wp-config.php and new rewrite rules for .htaccess (or your Nginx configuration). Once you add them and log in again, you'll have a Network Admin dashboard where you can create and manage multiple sites from a single WordPress installation.

Multisite is one of WordPress's most powerful built-in features, but it changes how your installation works in fundamental ways. This guide explains what Multisite is, when it makes sense (and when it doesn't), the requirements, and the complete setup process, including server configuration for Apache and Nginx, WP-CLI options, domain mapping, and common troubleshooting.

What Is WordPress Multisite?

WordPress Multisite lets you run a network of websites from one WordPress installation. All sites share the same core files, themes, and plugins, and the same database, though each site gets its own set of database tables for content and settings.

Multisite introduces a new role called Super Admin, who controls the entire network. Individual sites can have their own administrators, who manage their site's content but can't install plugins or themes for the network.

Multisite powers large networks, such as university departments, franchise businesses, newspaper groups, and WordPress.com itself, which grew from the same codebase.

When Should You Use Multisite?

Multisite is a good fit when:

  • Sites share a common base: For example, a university with department sites that use the same theme and plugins.
  • You manage many similar sites: An agency hosting multiple client microsites with a standard toolkit.
  • You need a multilingual structure by site: Some translation setups, such as MultilingualPress, use a separate site per language.
  • Users should create their own sites: Like a blog network or learning platform where members get their own site.
  • You want centralized updates: Update WordPress, a theme, or a plugin once and it applies to every site.

When Should You Avoid Multisite?

Multisite isn't right for every situation:

  • Completely different sites: If each site needs different plugins, hosting requirements, or owners, separate installations are simpler.
  • Shared hosting with limited resources: A network runs on one hosting account, so a traffic spike on one site affects all of them.
  • Plugin compatibility concerns: Most well-maintained plugins support Multisite, but some don't, and a few behave differently network-wide.
  • Independent migrations: Moving a single site out of a network is more involved than migrating a standalone site.
  • Security isolation: A vulnerability in a network-activated plugin affects every site.

If you mainly want to manage multiple independent sites from one place, a management tool like MainWP or ManageWP may suit you better than Multisite.

Subdomains vs. Subdirectories

You'll choose one structure for your whole network during setup, and it's difficult to change afterwards:

  • Subdomains: Sites live at site1.example.com, site2.example.com. This requires wildcard DNS (a * record) and ideally a wildcard SSL certificate.
  • Subdirectories: Sites live at example.com/site1/, example.com/site2/. No special DNS is needed, making it easier to set up.

A few rules apply:

  • If your WordPress site has existed for more than a month with published posts, WordPress only allows the subdomain option, to avoid URL conflicts with existing content.
  • If WordPress is installed at localhost or on an IP address, only subdirectories are available.
  • If WordPress lives in a subfolder like example.com/wordpress/, subdomains aren't available.

Regardless of your choice, you can map custom domains to individual sites later, so site1.example.com could become clientbrand.com.

Requirements Before You Start

Make sure you have:

  1. A full backup: Files and database. Test that you can restore it.

  2. FTP, SFTP, or file manager access: You'll edit wp-config.php and .htaccess.

  3. Pretty permalinks enabled: Go to Settings > Permalinks and make sure you're not using the "Plain" structure.

  4. Deactivated plugins: WordPress asks you to deactivate all plugins before enabling the network. You'll reactivate them afterwards.

  5. For subdomains, wildcard DNS: Add a wildcard A record for *.example.com pointing to your server's IP address, and configure your web server to accept wildcard subdomains. Many managed hosts handle this for you.

  6. A host that supports Multisite: Most do, but check your plan's terms, especially on budget or managed hosting.

Step 1: Allow Multisite in wp-config.php

Connect to your site via SFTP or your host's file manager and open wp-config.php in the WordPress root. Add this line above /* That's all, stop editing! Happy publishing. */:

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

Save the file and refresh your WordPress dashboard. This line simply unlocks the Network Setup screen; it doesn't enable Multisite on its own.

Step 2: Deactivate All Plugins

Go to Plugins > Installed Plugins, select all plugins with the checkbox at the top, choose Deactivate from the Bulk actions menu, and click Apply. If you have WP-CLI, you can do it with one command:

wp plugin deactivate --all

Step 3: Run Network Setup

  1. Open Network Setup: Go to Tools > Network Setup.

  2. Choose your structure: Select Sub-domains or Sub-directories, if WordPress offers the choice.

  3. Name your network: Enter a Network Title, such as "Example Network."

  4. Set the Network Admin Email: Use an address you check regularly.

  5. Install: Click Install.

WordPress now displays a screen with two code blocks you need to add to your server. Keep this screen open.

Step 4: Add the Network Code to wp-config.php

Copy the first block from the Network Setup screen and paste it into wp-config.php directly below the WP_ALLOW_MULTISITE line you added earlier. It looks like this for a subdirectory network:

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 );

For a subdomain network, SUBDOMAIN_INSTALL is set to true. Always copy the exact values WordPress gives you rather than typing them by hand.

Step 5: Update Your Server Rewrite Rules

Apache (.htaccess)

Replace the existing WordPress rules in the .htaccess file in your site root with the rules WordPress provides. For a subdirectory network, they look like this:

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 a subdomain network, the rules are simpler:

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

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

Keep any other rules in the file, such as those added by caching or security plugins, outside the WordPress section.

Nginx

Nginx doesn't read .htaccess, so you add rules to your server block instead. For a subdirectory network, a typical configuration looks like this:

server {
    listen 80;
    server_name example.com;
    root /var/www/example.com;
    index index.php;

    if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$request_uri/ permanent;
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;
    }

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Adjust the PHP-FPM socket path to match your server. For a subdomain network, use server_name example.com *.example.com; and the standard try_files rule; the subdirectory rewrites aren't needed. Test the configuration with sudo nginx -t and reload with sudo systemctl reload nginx.

Step 6: Log In Again

Save your changes and log in to WordPress again. You'll need to log in again because Multisite changes how authentication cookies work. You'll now see a My Sites menu in the admin bar, with a Network Admin link.

Step 7: Reactivate Your Plugins

In Network Admin > Plugins, you'll see two ways to activate plugins:

  • Network Activate: Turns the plugin on for every site in the network.
  • Activate on individual sites: Leave the plugin installed but not network-activated. Site admins can then activate it on their own site from their dashboard, if you allow it under Network Admin > Settings > Network Settings in the Menu Settings section.

Reactivate plugins one at a time and check for issues, especially for security, caching, and SEO plugins, which often have Multisite-specific settings.

Setting Up Multisite with WP-CLI

If you're starting from a fresh install, WP-CLI can convert it to Multisite in one command:

wp core multisite-convert --title="Example Network"

Add --subdomains for a subdomain network. For a brand-new installation, you can install directly as Multisite:

wp core multisite-install --url=example.com --title="Example Network" --admin_user=siteowner --admin_email=you@example.com --prompt=admin_password

These commands update wp-config.php for you, but you still need to add the correct rewrite rules to your server.

Configuring Network Settings

Go to Network Admin > Settings > Network Settings to configure network-wide options:

  • Allow new registrations: Decide whether users can register accounts, create sites, both, or neither. For most private networks, keep registration disabled.
  • Registration notification: Get notified when new users or sites are registered.
  • Add New Users: Allow site administrators to add users to their site.
  • Banned Names and Banned Email Domains: Prevent certain site names or email domains.
  • Upload Settings: Set the upload space per site and allowed file types.
  • Max upload file size: Limit the size of individual uploads.
  • Language Settings: Set the default language for new sites.

Adding a New Site to the Network

  1. Open the Sites screen: Go to Network Admin > Sites > Add New Site.

  2. Enter the site address: Type the subdomain or subdirectory name, such as shop.

  3. Set the site title and language: Enter the title and choose a language.

  4. Assign an admin email: Enter the email of the site's administrator. If the user doesn't exist, WordPress creates one and emails login details.

  5. Create the site: Click Add Site.

Or, with WP-CLI:

wp site create --slug=shop --title="Example Shop" --email=shopadmin@example.com

Managing Themes on a Network

Themes are installed network-wide but must be network enabled before site admins can use them. Go to Network Admin > Themes and click Network Enable under any theme you want available. Site admins can then choose from enabled themes under Appearance > Themes. You can also enable a theme for just one site from Network Admin > Sites, by editing the site and using its Themes tab.

Mapping Custom Domains to Sites

Since WordPress 4.5, domain mapping is built into core, so you don't need a plugin for basic use:

  1. Point the domain to your server: At the domain's DNS provider, add an A record pointing to your server's IP address.

  2. Add the domain to your hosting: Add it as an alias or parked domain so the server responds to it, and issue an SSL certificate for it.

  3. Update the site address: Go to Network Admin > Sites, click Edit on the site, and change the Site Address (URL) to the new domain, such as https://clientbrand.com.

  4. Handle login cookies: If users have trouble logging in on mapped domains, add this to wp-config.php:

define( 'COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );

Test logging in on both the main site and mapped domains after making this change.

Writing Multisite-Aware Code

If you develop plugins for a network, WordPress provides helper functions. For example, this snippet loops through every site and counts published posts:

function sajjad_network_post_counts() {
    if ( ! is_multisite() ) {
        return array();
    }

    $counts = array();
    $sites  = get_sites( array( 'number' => 100 ) );

    foreach ( $sites as $site ) {
        switch_to_blog( $site->blog_id );
        $counts[ $site->blog_id ] = (int) wp_count_posts( 'post' )->publish;
        restore_current_blog();
    }

    return $counts;
}

Always pair switch_to_blog() with restore_current_blog(), and be careful running this on large networks, since switching between many sites is expensive. For plugin-wide settings, use get_site_option() and update_site_option(), which store data at the network level instead of per site.

Troubleshooting Common Multisite Issues

Redirect loops after enabling Multisite: Double-check that DOMAIN_CURRENT_SITE exactly matches your domain, with or without www, and clear browser cookies.

New subdomain sites don't load: Wildcard DNS isn't set up, or your server isn't configured to accept wildcard subdomains. Ask your host for help.

Images on subdirectory sites return 404: Your rewrite rules are incomplete. Replace them with the exact rules shown in Network Admin > Settings > Network Setup.

Network Setup option is missing: Confirm that WP_ALLOW_MULTISITE is placed above the "stop editing" line and that you're logged in as an administrator.

Site admins can't install plugins: That's by design. Only Super Admins can install plugins and themes in a network.

Plugins behave strangely: Check whether the plugin supports Multisite and whether it should be network-activated or activated per site.


FAQ: WordPress Multisite

WordPress Multisite is a built-in feature that lets you run a network of multiple websites from a single WordPress installation, sharing core files, themes, and plugins.

Subdirectories are easier because they don't need wildcard DNS. Subdomains give each site a more distinct address. Either way, you can later map custom domains to individual sites.

Yes. Domain mapping is built into WordPress core. Point the domain to your server, then change the site's address under Network Admin > Sites.

All sites share the same installed plugins and themes, but a Super Admin chooses which themes are enabled and which plugins are network-activated. Plugins that aren't network-activated can be activated per site.

It's possible but complicated. You'd need to export the sites you want to keep and migrate them to standalone installations. Plan carefully before enabling Multisite.

Not inherently, but all sites share the same server resources. A busy network needs appropriate hosting, caching, and possibly a persistent object cache like Redis.

  • Backup: A full, tested backup of files and database.
  • Access: SFTP or file manager access to edit wp-config.php and server rules.
  • Permalinks: Pretty permalinks enabled.
  • DNS: Wildcard DNS if you choose subdomains.

Conclusion

Setting up WordPress Multisite comes down to a few careful steps: allow Multisite in wp-config.php, run Tools > Network Setup, paste the generated code into wp-config.php and your server configuration, and log in again. From there, the Network Admin dashboard lets you add sites, enable themes, and manage plugins across your entire network.

Before you start, make sure Multisite genuinely fits your project, since it's harder to undo than to enable. If your sites share a common foundation and you want central control, Multisite can save you enormous amounts of time. Just back up first, choose your structure carefully, and test plugins as you reactivate them.

Tags :
Share :

Related Posts

What are the best WordPress security plugins?

What are the best WordPress security plugins?

The best WordPress security plugins for most sites are Wordfence, Sucuri Security, Solid Security, MalCare, All-In-One Security (AIOS), Patchstack, a

Dive Deeper
What is the difference between posts and pages in WordPress?

What is the difference between posts and pages in WordPress?

The main difference between posts and pages in WordPress is that posts are timely, dated entries that appear in your blog feed, archives, and RSS fee

Dive Deeper
How much does it cost to build a WordPress website?

How much does it cost to build a WordPress website?

Building a WordPress website can cost anywhere from roughly the price of a domain and a year of budget hosting, if you do it yourself with free tools

Dive Deeper