DEV Community

Cover image for Resetting a WordPress admin password
Chris Bongers
Chris Bongers

Posted on • Originally published at daily-dev-tips.com

Resetting a WordPress admin password

I'm not particularly eager to work on WordPress, but sometimes you inherit legacy code or have to support a client.

The worst thing is where you get access to the database, but nobody knows the login anymore.

So how do we go about changing the admin's password?

Pre: You must have access to the database!

Using phpMyAdmin to change the WordPress password

The first thing we need to do is log in to phpMyAdmin and find our database.

Then we need to open up the wp_users (wp can be underscored by something unique for your install).

PhpMyAdmin for WordPress install

Now we need to click the edit button on the admin record.

In the password field, add the new password in a readable way and choose MD5 as the Function.

Reset WordPress password

Please don't use passwords like this example above

Now you can click save, and we will be able to login with our new password!

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Top comments (4)

Collapse
 
gsarig profile image
Giorgos Sarigiannidis

For me, WP-CLI is by far the best way, as long as you have SSH access:

wp user update 1 --user_pass=mynewpass
Collapse
 
dailydevtips1 profile image
Chris Bongers

Nice one, sad enough many times with WordPress you won't have ssh access 😭

Collapse
 
aritdeveloper profile image
Arit Developer

Awesome walkthrough! I remember my days as a WP freelancer and how excited I was when I figured out how to make db changes using phpAdmin 😃

Collapse
 
dailydevtips1 profile image
Chris Bongers

Thank you Arit, Yeah can be tricky when starting out with WordPress, how cool it's also where my development started 🤟