Read a user
wp_get_userRetrieve a WordPress user account by ID, username, or email to fetch profile details such as display name, roles, and registration date. Use it for exact account lookups.
Instructions
Get one user account by id, login or email. Returns id, login, email, name (display name), first_name, last_name, roles and registered (site time with UTC offset). Needs list_users. No match, or none of the three given, is a not-found error; an account known only by part of its name is found with wp_list_users (search). User meta is read by wp_get_user_meta.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | User id. Takes precedence over login and email. | |
| No | Email address, exact. Used when neither id nor login is given. | ||
| login | No | Username (user_login), exact. Used when id is not given. |