How to reset WordPress Password using wpcli

If you lost your WordPress user password, you can use forget password link on the WordPress login screen to reset the password. For any reason, if you were unable to receive the password reset email, you have to reset your password by editing the wp_users table in MySQL Database or by using the WordPress command line tool (wpcli).

If you don’t have wpcli installed, you can install it with

For root users

If you are logged in as a normal user, run the following command

To make wp command available when using as normal user, you need to run

To make it permanent, you can edit the file ~/.bashrc and add the above line to the end of the file, so it gets executed whenever you log in to the server.

To list all users, you can run

To list all users with administrator role, run

To reset the password for a user, run

Reset the WordPress user password by editing wp_users table using phpMyAdmin

Back to WordPress

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *