The command line interface for WordPress

Commands » user

wp user - Manage users.

Quick links: Github issues


# List user IDs
$ wp user list --field=ID

# Create a new user.
$ wp user create bob [email protected] --role=author
Success: Created user 3.
Password: k9**&I4vNH(&

# Update an existing user.
$ wp user update 123 --display_name=Mary --user_pass=marypass
Success: Updated user 123.

# Delete user 123 and reassign posts to user 567
$ wp user delete 123 --reassign=567
Success: Removed user 123 from http://example.com


Name Description
add-cap Add a capability to a user.
add-role Add a role for a user.
create Create a new user.
delete Delete one or more users from the current site.
generate Generate some users.
get Get details about a user.
import-csv Import users from a CSV file.
list List users.
list-caps List all capabilities for a user.
meta Manage user custom fields.
remove-cap Remove a user's capability.
remove-role Remove a user's role.
session Manage a user's sessions.
set-role Set the user role.
term Manage user terms.
update Update an existing user.