Updating a user password using WP CLI (WordPress’ Command Line Interface) couldn’t be easier! You simply have to start off by getting the ID of the user that you want to update and then you update the user’s password.
These steps assume that you have installed WP CLI on your server. If you haven’t already done so, install WP CLI on your server by reading our instructions.
The two steps are outlined in detail below:
STEP 1: Get a List of Users
SSH into the server that contains your WordPress site and navigate using cd commands to the root directory of your WordPress installation. Use the
wp user list WP CLI command to get a list of WordPress users.
wp user list
This will bring up a graphic (similar to the one shown below) that shows the user’s with their ID’s on the far left:
STEP 2: Update User’s Password
wp user update ID WP CLI command and reference the
--user_pass argument to update the user’s password.
wp user update 14 --user_pass=leespassword!!
Now you can login to your WordPress dashboard at www.mywordpresssite.com/wp-login.php.