wp site create
Overview
Add a new site to your multisite network instantly. This command handles creating the database tables for the subsite and registering it in the wp_blogs table.
Syntax
wp site create --slug=<slug> [--title=<title>] [--email=<email>] [--network_id=<id>] [--private] [--porcelain]
Options
| Flag | Description |
|---|---|
--slug=SLUG | The path or subdomain for the new site |
--title=TITLE | The title for the new site (default: slug) |
--email=EMAIL | Email address for the site administrator |
--network_id=ID | The ID of the network to create the site on |
--private | Set the site as private |
--porcelain | Output only the new site ID |
Basic Usage
Create a subdirectory site
wp site create --slug=marketing --title="Marketing Blog" --email=marketing@example.com
Output:
Success: Site 2 created: http://example.com/marketing/
Create a subdomain site
wp site create --slug=shop --title="Online Store"
Output:
Success: Site 3 created: http://shop.example.com/
Real-World Scenarios
Scenario 1: Provisioning sites for new clients
SITE_ID=$(wp site create --slug=client-alpha --porcelain)
wp user create client_admin admin@clientalpha.com --role=administrator --url=example.com/client-alpha
echo "New site created with ID: $SITE_ID"
Scenario 2: Creating a Private Staging Site
wp site create --slug=dev-test --title="Internal Staging" --private
Quick Reference
wp site create --slug=news --title="Recent News"
wp site create --slug=test --porcelain # Get only the ID
Next Steps
wp site list— view all created sites.wp site delete— remove a site.