WP-CLI user commands let you list users, create new users, update passwords, change roles, and delete accounts. The most common real-world use is resetting a lost administrator password when the email-based reset is not working.
Command reference
| Command | What it does |
|---|---|
wp user list | Lists all WordPress users with their ID, email, role, and status |
wp user list --role=administrator | Lists only administrators |
wp user get <id> | Shows full details for a specific user by ID |
wp user create <username> <email> --role=editor | Creates a new user with the specified role |
wp user update <id> --user_pass=<password> | Sets a new password for a user (use a strong password) |
wp user update <id> --role=administrator | Changes a user's role |
wp user delete <id> --yes | Permanently deletes a user (--yes skips the confirmation prompt) |
wp user session destroy --all | Logs out all active sessions for every user (useful after a security incident) |
wp user meta get <id> <meta-key> | Reads a specific piece of user metadata |
Resetting a lost password
If you are locked out of your WordPress dashboard and the email-based password reset is not working, you can reset your password from the terminal.
- Run
wp user listto find your admin user ID.
wp user list
-
Find your user in the list and note the ID number in the first column.
-
Set a new password using the user ID:
wp user update 1 --user_pass=MyNewStrongPassword123
- Go back to your Web60 dashboard and click Open WordPress to log in with your new password.
Security note
User IDs returned by wp user list are WordPress database IDs, not email addresses. Always confirm you have the correct user ID before running an update or delete command.
Need help?
If you have questions about managing users, visit our support page or email hello@smarthost.ie.
Frequently asked questions
How do I reset my WordPress admin password if I'm locked out?
Open the terminal in your Web60 dashboard, run wp user list to find your admin user ID, then run wp user update <id> --user_pass=<newpassword>. Then click Open WordPress in your dashboard to log in.
What roles can I assign when creating a user?
WordPress roles include: administrator, editor, author, contributor, subscriber. Use the exact role name in lowercase.
What does wp user session destroy --all do?
It invalidates all active login sessions for all users on the site, effectively logging everyone out. Useful if you suspect unauthorised access.
Last updated: 25 March 2026
