Reset WordPress user password using WP-CLI

In this guide We’ll cover how to reset a WordPress user password using WP-CLI.

Step 1. Ensure WP-CLI is installed and you are in the website directory

run the following command to check if you are in the right folder:

 wp option get home && wp option get siteurl

Step 2. List all users and note user_login for the user

Step 3. Replace the USER placeholder in this command and NewPassword with a strong password, then run:

 wp user update USER --user_pass=NewPassword

For more useful WP-CLI guides check this guide: Most useful WP-CLI commands with examples + how to fix most common WPCLI errors

Was this post helpful?

Leave a Comment