Update a user
update_userUpdate a WordPress user's profile, email, password, or roles to adjust their access and permissions. Changing roles redefines what the user can do on the site.
Instructions
Update a user's profile, email, password or roles. Changing roles changes what that person can do — promoting to administrator grants full site control.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The user ID, or "me". | |
| url | No | Website URL. | |
| meta | No | Custom fields as key/value pairs, for keys registered with show_in_rest. | |
| name | No | Display name. | |
| slug | No | Author archive slug. | |
| No | Email address. | ||
| roles | No | Replace the user's roles. | |
| locale | No | User interface locale, e.g. "en_GB". | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| nickname | No | Nickname, used by some themes. | |
| password | No | New password. This immediately invalidates the user's existing sessions. | |
| last_name | No | Family name. | |
| first_name | No | Given name. | |
| description | No | Longer descriptive text. |