Skip to main content

wp core multisite-install

Overview

Install the multisite version of WordPress from scratch. This command handles the database installation, creates the first network, sets up the super admin, and provides the necessary wp-config.php and .htaccess constants.

What It Does

wp core multisite-install converts a standard (uninstalled) WordPress directory into a Multisite network. It installs the tables required for a network and configures the first site. Note: This is for fresh installs. To convert an existing single site to multisite, use wp core multisite-convert.

Syntax

wp core multisite-install [OPTIONS]

Options

FlagDescription
--url=URLThe URL of the new network
--title=TITLEThe title of the new network
--admin_user=USERUsername for the super admin
--admin_password=PWPassword for the super admin
--admin_email=EMAILEmail for the super admin
--subdomainsUse subdomains (e.g., site1.example.com) instead of subdirectories
--skip-configDon't output the configuration constants

Basic Usage

Install as subdirectories (Default)

wp core multisite-install \
--url=example.com \
--title="My Network" \
--admin_user=admin \
--admin_password=password \
--admin_email=admin@example.com

Output:

Success: Network installed.

Install as subdomains

wp core multisite-install \
--url=example.com \
--title="My Global Network" \
--admin_user=superadmin \
--subdomains

After Installation

After running the command, WP-CLI will output the constants you need to add to your wp-config.php.

Example Output snippet:

define( 'WP_ALLOW_MULTISITE', true );
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 );

Real-World Scenarios

Scenario 1: Automated Dev Network Setup

#!/bin/bash
wp core download
wp config create --dbname=wp_multisite --dbuser=root --dbpass=root
wp db create
wp core multisite-install --url=dev.local --title="Dev Network" --admin_user=dev --subdomains

Scenario 2: Installing without echoing sensitive config

wp core multisite-install --url=example.com --title="Silent Install" --admin_user=admin --skip-config

Best Practices

  1. Decide strategy early — Switching between subdomains and subdirectories later is difficult.
  2. Use strong passwords — The first user created is a Super Admin with full network access.
  3. Backup before conversion — If you are trying to "re-install" over a messy state, clean the DB first.

Next Steps