Skip to main content

wp core multisite-install

Overview

Convert a single WordPress site into a multisite network from the command line. Sets up the network database tables and rewrites wp-config.php and .htaccess as needed.

What It Does

wp core multisite-install runs the multisite network installation against an existing WordPress install. It creates the wp_blogs, wp_site, wp_sitemeta, and other network tables, and sets up the first site of the network.

Prerequisites

WordPress must already be installed (wp core install) before running this command. For a brand-new multisite network on an empty install, use wp core multisite-install directly after wp config create and wp db create.

Syntax

wp core multisite-install [--title=<network-title>] [--base=<url-path>] [--subdomains] [--skip-config] [--skip-email]

Options & Flags

FlagDefaultDescription
--title=TITLESite titleTitle for the network
--base=PATH/Path base for the network (e.g. /network/)
--subdomainsUse subdomain URLs (site1.example.com) instead of subdirectory (example.com/site1/)
--skip-configDo not update wp-config.php automatically
--skip-emailDo not send notification email

Basic Usage

Subdirectory network (default)

wp core multisite-install \
--title="My Network" \
--skip-email

Subdomain network

wp core multisite-install \
--title="My Network" \
--subdomains \
--skip-email

Expected Output

Set up multisite database tables.
Added multisite constants to 'wp-config.php'.
Success: Network installed. Don't forget to set up rewrite rules (see https://developer.wordpress.org/apis/multisite/).

What Gets Modified

After running wp core multisite-install, WP-CLI:

  1. Creates additional database tables: wp_blogs, wp_blog_versions, wp_registration_log, wp_signups, wp_site, wp_sitemeta, wp_users (shared)

  2. Adds constants to wp-config.php:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false ); // or true for subdomain
    define( 'DOMAIN_CURRENT_SITE', 'example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
  3. Updates .htaccess (Apache) or prompts for Nginx rewrite rules.

Real-World Scenarios

Scenario 1: Brand new multisite from scratch

cd /var/www/html
wp core download
wp config create --dbname=networkdb --dbuser=wpuser --dbpass=secret
wp db create
wp core install \
--url="https://example.com" \
--title="Main Site" \
--admin_user=netadmin \
--admin_password=Admin1234! \
--admin_email=admin@example.com \
--skip-email
wp core multisite-install --title="My Network" --skip-email

Scenario 2: Agency multisite with subdomains

wp core multisite-install \
--title="Agency Network" \
--subdomains \
--skip-email

# Create client sites
wp site create --slug=client1 --title="Client One" --email=client1@example.com
wp site create --slug=client2 --title="Client Two" --email=client2@example.com

Scenario 3: Subdirectory multisite with custom base

wp core multisite-install \
--title="Multi Blog Network" \
--base=/sites/ \
--skip-email

After Installation

Required .htaccess rules (Apache — subdirectory)

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
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 Nginx, see WordPress Multisite with Nginx.

Best Practices

  1. Back up before conversion if converting an existing single site.
  2. Use --subdomains for enterprise/agency networks — cleaner URLs and easier SSL with wildcard certs.
  3. Use subdirectory for lightweight blogs — simpler DNS setup.
  4. Configure wildcard DNS (*.example.com) before enabling subdomain multisite.
  5. Verify server rewrite rules — the network will not work correctly without them.

Troubleshooting

ProblemCauseFix
Child sites return 404Rewrite rules not updatedUpdate .htaccess or Nginx config
Admin can't access network dashboardMULTISITE not setCheck wp-config.php for multisite constants
Sites not accessible on subdomainsNo wildcard DNSConfigure *.example.com DNS record
Conversion fails on existing siteDB tables conflictCheck for stale network tables; run wp db check

Quick Reference

wp core multisite-install --title="Network" --skip-email          # Subdirectory
wp core multisite-install --title="Network" --subdomains --skip-email # Subdomain
wp site create --slug=newblog --title="New Blog" # Add a site
wp site list # List all sites

Next Steps