Skip to main content
MainWP includes WP-CLI integration for managing your Dashboard and child sites from the command line. This enables automation, scripting, and advanced management workflows.

What You’ll Learn

  • Available WP-CLI commands for site management
  • How to sync, update, and manage sites via command line
  • Example automation scripts

Prerequisites

  • MainWP Dashboard v4.1.3 or later
  • WP-CLI installed on your Dashboard server
  • Child sites connected to your MainWP Dashboard
For more information about WP-CLI, visit the official WP-CLI documentation.

Sites Management

Commands for managing multiple child sites simultaneously.

List All Sites

Displays every child site in your MainWP installation.

Count All Sites

Returns the total number of child sites.

Connected Sites

Lists only child sites with active connections.

Connected Sites Count

Returns count of actively connected child sites.

Disconnected Sites

Lists child sites that are currently disconnected.

Disconnected Sites Count

Returns count of disconnected child sites.

Sync All Sites

Synchronizes data across all child sites.

Check All Sites

Verifies the status of all child sites.

Example Workflows

Daily Sync Script

Create a script to sync all sites and check for updates:

Get Site Overview

Replace site IDs with your actual child site IDs. You can find site IDs by running wp mainwp sites --all-sites.

Self-Check Checklist

  • WP-CLI installed on Dashboard server
  • MainWP Dashboard v4.1.3 or later
  • Test basic command: wp mainwp sites --all-sites
  • Site IDs identified for site-specific commands