We’ve all been there. You swear to everything you believe in that you would not forget the password to your own WordPress site; yet there you are staring at the login screen with nothing but the error message telling you the impossible: you forgot your own password!
You have several options at this point. Hopefully, you have a password manager and you just need to look it up. You could always use WordPress’ password recovery system. But wait, this is MY server why do I need to go through all that. I know what I thought/know that password should be!
Reseting a WordPress users’ password.
This first thing that comes to mind for me is to just reset the password at the database level. This will work, however, you have to ensure that your new password string employs the correct hash/salt scheme for your version of WordPress.
WordPress CLI to the rescue
Click here for installation instructions
IMPORTANT! You must be in the directory where WordPress resides when running theses commands.
$ wp user list
$ wp user update USERNAME --prompt=user_pass --skip-email
Full list of options here
Boom! No-one needs to know you forgot your own password 😉