Patch site metadata
const url = 'https://example.com/wp-json/wp2/site-manager/v1/sites/1';const options = { method: 'PATCH', headers: {'X-WP-Nonce': '<X-WP-Nonce>', 'Content-Type': 'application/json'}, body: '{"title":"Training project","status_id":12,"category_ids":[3]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/wp-json/wp2/site-manager/v1/sites/1 \ --header 'Content-Type: application/json' \ --header 'X-WP-Nonce: <X-WP-Nonce>' \ --data '{ "title": "Training project", "status_id": 12, "category_ids": [ 3 ] }'Partial PATCH: only supplied keys change (title/slug/description/status_id/category_ids/archived/public/is_template). Site content is not copied.
Changing the main site slug — 403 `main_site_slug_forbidden`. archive/public on the main site — 403 `main_site_forbidden`. Taken address — 409 `slug_conflict`.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Site ID in the current network (WP_Site->blog_id). A site from another network — 404 site_not_in_network.
Request Body
Section titled “Request Body”object
New blogname. Optional; missing key — leave unchanged. PHP sanitizes and writes the blog option plus site meta blogname.
New address slug. Optional. PHP normalizes and checks domain_exists; another site with the same domain+path — 409 slug_conflict. Network main site — 403 main_site_slug_forbidden.
New blogdescription. Optional; PHP writes sanitize_text_field to the blog option.
Site Manager status ID or null to clear it. The key must be present (array_key_exists); otherwise PHP leaves status alone. Unknown term — 400 invalid_term.
Full set of site category IDs. If the key is present (even an empty array) PHP overwrites meta. Each id must be a category term; otherwise 400 invalid_term.
True — update_blog_status(..., archived, 1); false — clear archive. Main site — 403 main_site_forbidden. Not the integer flag in SiteDto.
1 — activate the site (WP_Site->public=1); otherwise deactivate (0). Main site — 403 main_site_forbidden.
Writes site meta wp2platform_site_manager_is_template (1 or 0). JSON key must be present, otherwise PHP leaves the flag alone.
Example
{ "title": "Training project", "status_id": 12, "category_ids": [ 3 ]}Responses
Section titled “Responses”Site after applying the patch (SiteMetadata::to_array).
object
Site ID in the current network (WP_Site->blog_id). Path {blog_id} on the same operations is the same number.
ID of the network the site belongs to (WP_Site->site_id). Not blog_id and not CreateNetworkRequest.domain.
Site title — blog option blogname (get_option on this site). Not the network option site_name.
Site address slug. On SUBDOMAIN_INSTALL — subdomain relative to the network domain; otherwise the WP_Site->path segment without slashes. PHP derives it in SiteSlugService::derive_slug_from_site.
Site host in the blogs table (WP_Site->domain), without an https:// scheme.
Site path in the blogs table (WP_Site->path) with slashes (often / on subdomains or /training/ on subdirectory). Not a Local Sync file path.
Site tagline — blog option blogdescription.
Site Manager status taxonomy term ID (site meta wp2platform_site_status). null if unset or id=0.
Expanded Site Manager status term. null if unset. Not the WP_Site->public flag.
object
Status term_id.
Status display name.
Status term slug (sanitize_title).
Site Manager category term IDs (site meta wp2platform_site_categories).
Expanded site categories (id, name, slug). PHP does not include parent inside SiteDto.
object
Site category term_id (Site Manager taxonomy, not post categories).
Term display name. In the list PHP may rewrite default labels via translate_default_term_label.
Category term slug (sanitize_title on write).
Parent term_id (WP_Term->parent); 0 — root. PHP omits this field in SiteDto.categories.
Public site URL (get_site_url(blog_id)).
This site’s wp-admin URL (get_admin_url(blog_id)), not /wp-admin/network/.
Blog registration date (WP_Site->registered), as core stores it.
Blog last-updated date (WP_Site->last_updated).
WP_Site->public flag (1 — public/active, 0 — unpublished). Not a Site Manager status term.
WP_Site->archived flag (1 — archived, 0 — not).
WP_Site->deleted flag in the blogs table (core marked the site deleted). Not the result of this API’s DELETE.
WP_Site->spam flag (1 — marked as spam).
WP_Site->mature flag.
True if this is the network main site (is_main_site(blog_id)). It cannot be deleted, archived, deactivated, or have its slug changed via this API (main_site_forbidden / main_site_slug_forbidden).
True if site meta wp2platform_site_manager_is_template is 1 (duplication template site).
User count on the site (count_users()['total_users']). PHP adds the field only if query include contains stats; otherwise the key is absent.
Example
{ "blog_id": 5, "network_id": 1, "title": "Training project", "slug": "training", "domain": "training.example.com", "path": "/", "description": "Course sandbox", "status_id": 12, "status": { "id": 12, "name": "In progress", "slug": "in-progress" }, "category_ids": [ 3 ], "categories": [ { "id": 3, "name": "Training projects", "slug": "training", "parent": 0 } ], "site_url": "https://training.example.com/", "admin_url": "https://training.example.com/wp-admin/", "registered": "2024-03-01 10:15:00", "last_updated": "2026-09-12 18:40:11", "public": 1, "archived": 0, "deleted": 0, "spam": 0, "mature": 0, "is_main_site": false, "is_template": false, "user_count": 4}Invalid_term — unknown status/category; invalid_network — could not build domain/path.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Not authenticated. DualRest: rest_forbidden (status 401) when there is no cookie session. Cookie + X-WP-Nonce or Application Password.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Forbidden (no permission on the blog), main_site_slug_forbidden, main_site_forbidden, or invalid REST nonce.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Site_not_in_network / site_not_found.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Slug_conflict — this slug is already used by another site in the network.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}