Reset WordPress User Password Using WP-CLI

WP-CLI (WordPress Command Line Interface) is a WordPress function enabled for WordPress Hosting at InMotion. If you’re unable to login, there are multiple ways to reset your WordPress password, including via Softaculous. Here we’ll cover how to reset a WordPress user password using WP-CLI.

Reset the User Password

  1. SSH into your server and the cPanel user which owns the website using the correct steps for your hosting plan – shared or VPS/Dedicated.
  2. Use the cd command to enter the domain’s document root, e.g. cd public_html

    NOTE: Be sure to replace public_html/my_website with the actual path to the document root directory of your website.

  3. Ensure you’re in the correct WordPress installation with the following command:
    wp option get home && wp option get siteurl
  4. To list all users within that website, type the following command:
    wp user list

    Below is an example of the expected output.

    WP CLI wp user list screenshot

  5. Use the following command to reset the WordPress user password replacing USER with the appropriate user-login and NewStrongPassword with a strong password:
    wp user update USER --user_pass=NewStrongPassword

Congratulations on resetting your WordPress user password from the command line. Learn more about WP-CLI at our WP-CLI Education Channel.

Leave a Reply