Update WordPress User
wp_update_userUpdate an existing WordPress user's name, email, profile fields, or roles. Replace roles to demote an admin to editor or subscriber.
Instructions
Update an existing user's name, email, roles, or profile fields. Common use: demoting an admin to editor or subscriber.
Args:
id (number): User ID. Required.
name, email, first_name, last_name, url, description, slug: optional fields to update.
roles (string[]): Replaces existing roles. e.g. ['editor'], ['subscriber'], ['administrator'].
response_format (enum): markdown | json. Default 'markdown'.
Returns: The updated WPUserItem.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | User ID to update. | |
| url | No | Personal website URL. | |
| name | No | Display name. | |
| slug | No | URL slug for author archive. | |
| No | Email address. | ||
| roles | No | Roles to assign (e.g. ['editor'] or ['subscriber']). Replaces existing roles. | |
| last_name | No | Last name. | |
| first_name | No | First name. | |
| description | No | Bio. | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |