WP-CLI can reset a WordPress user’s password when you cannot use the normal dashboard recovery process. You need authorised SSH access to the site’s files and a working WP-CLI installation.

Identify the site and user

Connect as the site’s owning user and change to its actual WordPress directory:

cd /path/to/wordpress
wp --info
wp user list --fields=ID,user_login,user_email,roles

Check that the directory and listed account belong to the intended site. On multisite, specify the appropriate site using WP-CLI’s --url option.

Reset the password

Replace 123 with the verified user ID:

wp user update 123 --prompt=user_pass

Enter a strong, unique password when prompted. This avoids placing it directly in the command and shell history. Keep terminal recordings and the new password private.

Verify access

Read the success message and test a new WordPress login. Update any authorised integrations that depend on that password.

If the user cannot be found, check the installation directory and selected site. If wp is unavailable or file permissions prevent access, use the correct hosting account or contact the provider rather than bypassing permissions as root.