WP-CLI » Reset WordPress user password using WP-CLI

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

image 40 - Reset WordPress user password using WP-CLI

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

 wp user update USER --user_pass=NewPassword
image 41 - Reset WordPress user password using WP-CLI

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

See also  5 Easy Ways To Speed Up Your WordPress ⚡

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended