wp_update_term
Update an existing WordPress term by changing its name, slug, parent, or description. Use dry-run mode to preview changes before applying, ensuring safe edits.
Instructions
Rename or re-parent one existing term.
fields is an object of field -> value; only name, slug, parent and description
can be changed and anything else is refused. CHANGING A SLUG CHANGES THAT TERM'S
ARCHIVE URL (/category/old/ starts 404ing), so treat it like wp_change_slug.
Passing no fields at all is refused rather than reported as a no-op success.
term_id comes from wp_list_terms. DEFAULTS TO dry_run=true (returns a preview of
the exact fields; writes nothing). Pass dry_run=false to apply. Requires the REST
transport. Prod writes require allow_prod=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | ||
| dry_run | No | ||
| install | Yes | ||
| term_id | Yes | ||
| taxonomy | Yes | ||
| allow_prod | No |