
Even in the age of password managers, I’m still horrible about not saving things correctly (or forgetting key bits of information relevant to logins). So if you ever find yourself locked out of your wordpress.org blog, here’s 3 ways you can get back in.
1 – If you have a separate admin and user account (recommended setup):
To change your password in current versions:
- In the Administration Screen, menu, go to Users > All Users.
- Click on your username in the list to edit it.
- In the Edit User screen, scroll down to the New Password section and click the Generate Password button.
- If you want to change the automatically generated password, you can overwrite it by typing a new password in the box provided. The strength box will show you how good (strong) your password is.
- Click the Update User button.
Your new password becomes active immediately.
2 – Use password reset feature:
At the login screen, typically yourblog.com/wp-admin, enter username or email and click ‘reset password’
If you’re unlucky like me, your inbox will destroy any emails sent and this wont work. Hopefully this doesn’t happen for you, because it’s the easiest and most straightforward method.
3 – Log into your wp back-end and manually update the mysql database:
Create a MD5 hash of your new password. Here’s a link to a simple web based one: https://www.miraclesalad.com/webtools/md5.php OR on Unix/Linux:
- Create file called new-wp.txt with ONLY the new password in it.
- echo -n ‘your_password_here’ | md5sum (-n removes new-line)
- save that string somewhere for later
Connect to your droplet/lightsail/ec2/etc (instance)
mysql -u root -p// (and enter your mysql password. if you don’t know this, you should be able to find it in root/ do anls -aland look for .digital-ocean_password or similar)LIST DATABASES;- USE (name of database, probably “wordpress”);
SHOW TABLES;// looking for one with “users”SELECT ID, user_login, user_pass FROM (name of table);// This shows us information about users, including user ID and nameUPDATE (name of table) SET user_pass="(md5 string)" WHERE ID = (relevant user ID);this changes password- (type Control-D to exit mysql client)
Hopefully one of these helped! Drop a comment with other methods or stories of when you got locked out of an application.
