Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk13 min

How to Use WP-CLI to Manage a WordPress Multisite Network

A practical WP-CLI guide to WordPress Multisite: install or convert a network, create and inventory sites, target one site with --url, run remote commands with --ssh, manage super administrators, and perform safer migrations.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WP-CLI lets you install, convert, inspect, and administer a WordPress Multisite network without opening the dashboard. Use wp core multisite-install for a new network, wp core install-network (the alias of wp core multisite-convert) to convert an existing site, wp site commands for individual sites, wp network and wp super-admin for network-wide administration, and the global --url option whenever a command must run in one site’s context.

This guide covers local and remote execution, subdomain and subdirectory networks, site lifecycle operations, migration safety, and the failure points that most often leave a network unusable.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What WP-CLI manages in a Multisite network

WP-CLI is the official command-line tool for interacting with and managing WordPress sites. In Multisite, one WordPress codebase serves several sites that share a database and a network-level administration layer. WP-CLI exposes both layers: commands such as wp site list work with the network’s sites, while ordinary plugin, theme, user, option, and cache commands can be directed at one site with --url.

The distinction between network and site context matters. A command run without a selector generally uses the installation’s default site. A command intended for every site must be deliberately looped over the site inventory or implemented with a network-aware command; WP-CLI does not silently turn every command into a network-wide operation.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Three contexts to keep straight

  • WordPress files: --path=<path> points WP-CLI at the installation containing wp-config.php.
  • Site context: In a Multisite installation, global --url=<url> selects the site whose options, plugins, themes, users, or content a command should address.
  • Network context: wp network, wp super-admin, and network metadata commands operate on the installation-wide administration layer.

Prerequisites and a safe operating model

Run commands from a shell account that can read the WordPress files and connect to the configured database. The account also needs the filesystem permissions required for whatever the command changes. Before conversion, deletion, or a URL migration, take a database and file backup and verify that you can restore them.

Check the installation before changing it

  1. Change to the directory containing wp-config.php, or plan to supply the absolute directory with --path.
  2. Run wp core version to confirm that WP-CLI is reading the intended WordPress installation.
  3. Run wp site list --field=url on an existing network. The output should be a list of the network’s site URLs, one per line.
  4. Use wp help <command>, for example wp help site create, to inspect the syntax supported by the WP-CLI version installed on that server. The command reference is regenerated at every release, so options can differ between versions.

Use a repeatable configuration

A wp-cli.yml file can hold aliases and common options for environments such as production, staging, and a local copy. This avoids repeatedly typing paths and remote connection details. Keep credentials out of files that are committed to a public repository, and review the resolved path and URL before running a destructive command.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install a new Multisite network with WP-CLI

For a new network, use wp core multisite-install. It creates the WordPress and Multisite database tables and adds the required Multisite constants to wp-config.php. Decide the URL model before running it: a subdirectory network places sites below the main path, while a subdomain network gives each site its own host name.

Choose subdirectory or subdomain URLs

Model Example site address What to pass Operational consideration
Subdirectory https://example.com/store/ Use a path-oriented --base and omit --subdomains. All sites share the main host; web-server rewrites must route the extra paths.
Subdomain https://store.example.com/ Add --subdomains; provide a base domain in --url. DNS and the web server must accept the additional host names, commonly through a wildcard configuration.

The table describes URL structure, not a guarantee that DNS or TLS is already configured. Prepare those services before users need to reach the new sites.

Run the installation command

From the directory where WordPress should be installed, adapt the documented workflow:

wp core multisite-install --url=example.com --base=/ --title="Company Network" --admin_user=networkadmin --admin_password="use-a-unique-secret" [email protected]

For a subdomain network, add --subdomains:

wp core multisite-install --url=example.com --base=/ --subdomains --title="Company Network" --admin_user=networkadmin --admin_password="use-a-unique-secret" [email protected]

Supply the administrator and title values appropriate for your installation. Do not place a real password in shell history on a shared machine; use the credential-handling method approved for your environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apply the web-server changes

The command writes the Multisite constants to wp-config.php, but the web server still has to route requests correctly. Apache users must apply the Multisite rewrite rules shown by the WP-CLI output or documentation to .htaccess. The official installation guidance specifically reminds Apache users to update that file. If you omit this step, the network can appear installed while site URLs return 404 errors, redirect loops, or downloads instead of rendered pages.

Verify the new network

  1. Run wp site list --field=url; the main site should be present.
  2. Run wp option get home and wp option get siteurl to confirm the primary URL.
  3. For a subdomain network, resolve the intended host names in DNS and request each host over the configured protocol.
  4. Run a harmless command against the main site, such as wp plugin list, to confirm that WP-CLI can bootstrap the network.

Convert an existing single site into Multisite

To convert an existing WordPress installation, use wp core install-network. It is an alias for wp core multisite-convert. The command creates the Multisite database tables and adds the required constants to wp-config.php; it does not create a second copy of the existing site’s files.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Conversion checklist

  • Back up the database and the complete WordPress files, including wp-config.php and uploads.
  • Confirm the canonical domain and whether new sites will use subdirectories or subdomains.
  • Ensure you have administrator access and the ability to edit configuration and rewrite files.
  • Schedule a maintenance window if the site receives writes during the conversion.

Run and finish the conversion

wp core install-network

If your workflow or installed WP-CLI version presents the command under its canonical name, the equivalent is:

wp core multisite-convert

After the command completes, inspect the constants it added to wp-config.php and apply the rewrite rules required by your web server. For Apache, update .htaccess with the appropriate Multisite rules. Test the existing site before creating additional sites; a conversion that reaches the database but not the web-server layer is incomplete from a visitor’s perspective.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Target the correct site every time

The global --url parameter is the key to site-scoped work. Put it before or after the command’s subcommand according to the syntax accepted by your WP-CLI version, and use the complete URL that WordPress recognizes.

Read a site’s settings

wp --url=https://example.com/store/ option get blogname

This reads the blogname option for the store site rather than the network’s default site. The same selector can be used with plugin, theme, user, role, rewrite, cache, and other site-level commands.

Run a change against one site

wp --url=https://example.com/store/ plugin update --all

Use a site URL that matches the network’s scheme, host, and path. A missing trailing path on a subdirectory site, an unexpected HTTP/HTTPS scheme, or a host alias not registered in the network can select the wrong context or produce a “site not found” error.

Inventory before looping over sites

wp site list --field=url

For a controlled batch operation, capture this output, review it, and then process one URL at a time. Site-list supports network and site-ID filters; consult wp help site list for the exact filter names available in your release. A reviewable inventory is safer than assuming that numeric IDs or URL patterns cover every site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create and inspect sites

Create a site on a subdirectory network

wp site create --slug=example

The documented example returns a success message such as Success: Site 3 created: www.example.com/example/. The slug becomes the path below the network base. Choose a slug that is unique, URL-safe, and consistent with your naming policy.

Create a site on a subdomain network

On a subdomain network, use a subdomain slug or provide a complete address with --site-url:

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
wp site create --slug=store
wp site create --site-url=https://store.example.com/ --title="Store"

DNS, TLS, and web-server host handling still determine whether that address is reachable. WP-CLI creates the WordPress record; it does not provision external DNS or certificates.

Confirm the new record

wp site list --field=url

Use wp site get when you need details for one site, and wp site meta or wp site option for metadata and settings. These commands are site administration tools, so include --url when the target is not the default site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the site lifecycle commands

The wp site command family covers state changes and per-site data. Treat state changes as operational controls, not as substitutes for backups.

Availability and visibility

  • wp site activate <id> and wp site deactivate <id> change whether a site is active.
  • wp site archive <id> and wp site unarchive <id> archive or restore a site.
  • wp site public <id> and wp site private <id> change public visibility.
  • wp site spam <id> and wp site unspam <id> mark or clear spam status.
  • wp site mature <id> and wp site unmature <id> set or clear the mature flag.

Run wp help site <subcommand> before changing a state if you need the accepted arguments or confirmation behavior for your installed release.

Empty or delete a site

wp site empty removes a site’s content while preserving the site record; wp site delete removes the site itself. Both are destructive. Export or back up anything required for recovery, verify the numeric ID or URL, and read the command’s local help for confirmation switches before proceeding. Do not treat a successful command response as proof that a backup is restorable.

Manage site metadata and options

Use wp site meta to get, add, update, delete, or list metadata associated with a site. Use wp site option for site-level options. Include the site ID or --url as required by the command syntax, and avoid editing serialized values manually when a dedicated command can preserve their structure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Administer the network layer

Network metadata

wp network meta can get, add, update, delete, and list custom fields attached to the network. This is distinct from a site option: network metadata belongs to the network record and should not be changed with a site-scoped option command.

Super administrators

Super administrators have network-wide capabilities. The quick-start handbook recommends wp super-admin add to grant those capabilities to an existing user.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
wp super-admin list
wp super-admin add username
wp super-admin remove username

Use the account’s existing user name as accepted by your installation, review the list before and after a change, and keep membership limited to people who require network administration. A site administrator is not automatically a super administrator.

Separate network actions from per-site actions

Installations, database upgrades, and super-administrator membership are network concerns. Plugin activation, theme settings, options, and content are usually site concerns. When uncertain, run wp help and test a read-only command with --url before issuing a write command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Run WP-CLI against a remote server or container

The global --ssh parameter executes WP-CLI on a remote server or container. Its documented form is:

--ssh=[<scheme>:][<user>@]<host|container>[:<port>][<path>]

Remote command examples

wp --ssh=ssh://[email protected]/var/www/wordpress core version
wp --ssh=ssh://[email protected]/var/www/wordpress site list --field=url

The remote path must point to the WordPress installation on that host. Authentication, SSH keys, the selected port, and container transport are infrastructure concerns; confirm them with a harmless version or site-list command before running updates or deletions.

Combine remote execution with site targeting

wp --ssh=ssh://[email protected]/var/www/wordpress --url=https://example.com/store/ option get blogname

Here --ssh selects where WP-CLI runs and --url selects which site WordPress bootstraps. Keeping those selectors explicit prevents a remote command from silently operating on the server’s default site.

Use aliases for repeated environments

Aliases in wp-cli.yml make staging and production targets easier to address consistently. Give each alias a clear name, include the remote path, and require an explicit environment choice in deployment scripts. Never assume that a command sent to an alias reached the intended host; print or log the resolved target before a destructive operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Maintain plugins, themes, languages, and caches

Once the network is healthy, the normal WP-CLI command index provides commands for core updates, plugin and theme management, language packs, cache operations, exports, users, roles, rewrites, search-replace, and site health. The important Multisite rule is scope: a plugin may be installed for the network but activated for individual sites, and a setting command may affect only the URL selected with --url.

Plan a network-wide update

  1. Inventory sites with wp site list --field=url.
  2. Back up the database and files, then test the backup.
  3. Update a staging copy first and exercise representative sites.
  4. Run the relevant core, plugin, theme, or language command with an explicit path and, where needed, an explicit site URL.
  5. Check front-end responses, login, scheduled tasks, and network administration after the change.

Do not infer network-wide success from one site’s result. A shared codebase can still expose site-specific plugin settings, themes, domains, and content failures.

Migrate URLs safely with search-replace

For a domain or URL migration, begin with a dry run. The quick-start workflow uses:

wp search-replace 'http://oldsite.com' 'http://newsite.com' --dry-run

Review the reported tables and replacement counts. The dry run does not write changes, so it is the point to catch an incorrect domain, protocol, path, or database target.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apply the reviewed replacement

wp search-replace 'http://oldsite.com' 'http://newsite.com'

Run the write operation only after the dry-run output matches the intended scope and you have a restorable backup. Test redirects, media, serialized settings, login, and every affected site. If the migration is for one site in a network, add the appropriate site context or otherwise constrain the database operation according to the command’s documented options; never assume a network database replacement is site-local.

Troubleshoot common failures

“Site not found” or the wrong site is changed

  • Confirm the exact URL with wp site list --field=url.
  • Include the scheme and path in --url, especially for subdirectory sites.
  • Check that --path points to the intended wp-config.php.
  • On a remote host, verify the --ssh path and account.

Pages return 404 after installation or conversion

Check the web-server rewrite layer. Apache installations require the Multisite rules in .htaccess; subdomain networks also require DNS and host configuration. Confirm that the request reaches the same WordPress path used by WP-CLI.

A subdomain site does not resolve

Creating a site record does not create DNS. Verify the subdomain or wildcard DNS record, the web server’s host matching, and the TLS certificate. Then rerun wp site list and test the exact URL with the same scheme used in WordPress.

A command succeeds but settings are unchanged

Check scope first. A command without --url may have run on the network’s default site. Re-run a read-only query with the target URL, inspect the command’s local help, and confirm that the operation was not network-level when you expected site-level behavior.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remote execution fails before WordPress loads

Test SSH authentication and the remote path with wp --ssh=... core version. A successful SSH connection is not enough if the remote user cannot read the WordPress files or the path does not contain the expected configuration.

A practical operating sequence

  1. Identify the target: choose the local path or SSH destination, then verify it with wp core version.
  2. Inventory: list URLs and record the site ID or URL you intend to change.
  3. Classify the action: decide whether it is network-level, site-level, read-only, or destructive.
  4. Select context: add --url for a site and use wp network or wp super-admin for network administration.
  5. Preview: use a list, get, help, or --dry-run mode where available.
  6. Back up: take and verify a restore-capable backup before conversion, deletion, or replacement.
  7. Execute: run the smallest command that accomplishes the change.
  8. Verify: query the resulting state and test the affected URL, login, and network functions.
  9. Record: keep the command, target, time, operator, and result so the change can be reproduced or reversed.

Command reference by task

Task Command or selector Scope
Install a new network wp core multisite-install Creates WordPress and Multisite tables and configuration.
Convert an existing site wp core install-network or wp core multisite-convert Adds Multisite tables and constants to the existing installation.
List site URLs wp site list --field=url Read-only network inventory.
Create a site wp site create --slug=example Adds a site record using a path or subdomain slug.
Select one site --url=<url> Sets the WordPress site context.
Select files --path=<path> Points WP-CLI at the installation.
Run remotely --ssh=[<scheme>:][<user>@]<host|container>[:<port>][<path>] Executes on a server or container.
Manage network metadata wp network meta Network custom fields.
Manage super administrators wp super-admin list|add|remove Network-wide administrator membership.
Preview a URL migration wp search-replace ... --dry-run Reports replacements without writing them.

When managed hosting is useful

A managed WordPress hosting plan designed for Multisite can reduce the infrastructure work around SSH access, backups, DNS, certificates, and server-level rewrites. It does not remove the need to understand WP-CLI scope: you still need the correct remote path, URL selector, permissions, backup process, and verification steps. Evaluate hosting on those operational requirements rather than on a dashboard label alone.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.