60Web60

Managing users with WP-CLI

WP-CLI2 min read·

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

CommandWhat it does
wp user listLists all WordPress users with their ID, email, role, and status
wp user list --role=administratorLists only administrators
wp user get <id>Shows full details for a specific user by ID
wp user create <username> <email> --role=editorCreates 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=administratorChanges a user's role
wp user delete <id> --yesPermanently deletes a user (--yes skips the confirmation prompt)
wp user session destroy --allLogs 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.

  1. Run wp user list to find your admin user ID.
wp user list
  1. Find your user in the list and note the ID number in the first column.

  2. Set a new password using the user ID:

wp user update 1 --user_pass=MyNewStrongPassword123
  1. 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

Still need help?

Contact our support team for personalised assistance.

Contact Support