How to create WordPress user with SSH using WP-CLI

Posted on: August 10th, 2022
By: Tadeo Martinez

You have to be under the public_html folder.

wp user create admin --role=administrator

Roles: ‘administrator’, ‘editor’, ‘author’, ‘contributor’, ‘subscriber’.

Here’s the WordPress documentation on wp user create command.

Learn How to connect to SSH with terminal here.

How to display all the users

wp user list

To update the user password

wp user update user_id --user_pass=password

To delete a user and reassigned their content to another user (recommended)

wp user delete username --reassign=anotherusername

If you simply want to delete a user (not recommended)

wp user delete username

Have any questions or comments? Write them below!

Leave a Reply

Your email address will not be published. Required fields are marked *