Skip to content

Update site category

PATCH
/wp-json/wp2/site-manager/v1/categories/{id}
curl --request PATCH \
--url https://example.com/wp-json/wp2/site-manager/v1/categories/1 \
--header 'Content-Type: application/json' \
--header 'X-WP-Nonce: <X-WP-Nonce>' \
--data '{ "name": "Training projects" }'

Partially updates the category term: name, slug, parent_id. Empty body — return the current term without writing. Requires manage_network.

id
required
integer

Site Manager category term_id.

Media typeapplication/json
object
name

New name. Missing key — leave unchanged.

string
slug

New slug (sanitize_title). Missing key — leave unchanged.

string
parent_id

New parent. The key must be present for PHP to change parent (including to 0).

integer
Example
{
"name": "Training projects"
}

Category after update.

Media typeapplication/json
object
id

Site category term_id (Site Manager taxonomy, not post categories).

integer
name

Term display name. In the list PHP may rewrite default labels via translate_default_term_label.

string
slug

Category term slug (sanitize_title on write).

string
parent

Parent term_id (WP_Term->parent); 0 — root. PHP omits this field in SiteDto.categories.

integer
Example
{
"id": 3,
"name": "Training projects",
"slug": "training",
"parent": 0
}

wp_update_term WP_Error other than term_exists.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

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.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}

Missing manage_network or invalid REST nonce.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}

Term_not_found — no such category term.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}

Term_exists — name/slug conflict.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}