The 4 Most Popular Tricks to Recover Your Lost WordPress Password

Become a WordPress Buff
The 4 Most Popular Tricks to Recover Your Lost WordPress Password
Share on twitter
Share on email
Share on facebook
Share on linkedin

Let’s be honest. Forgetting passwords is a pretty common occurrence. When you have a website on WordPress, you’re bound to misplace or forget your password every once in a while. Even the most tech-savvy people forget their passwords for WordPress sometimes.

This is no major concern because WordPress has made it pretty easy to recover your password securely. If you can’t recover your password by having WordPress email you a new one, things do get a bit more complicated; the good news is it’s never possible to get fully locked out of your website.

There are several ways by which you can easily recover your WordPress password. The easiest way would be to have your new password emailed to you from your WordPress login screen.

However, when your email reset isn’t working, you would have to take additional steps to recover your lost password. There are several ways to do this, but you only really need to apply one of them to recover your password.

Our team at WP Buffs helps website owners, agency partners and freelancer partners recover lost passwords and tighten up security. Whether you need us to manage 1 website or support 1000 client sites, we’ve got your back.

1. Email Password Recovery

Recovering your password by having it emailed to you is what we discussed above. This is useful when you remember the email account or username in your profile. All you would need to do is click the Lost your password? link below the login area on yourwebsite.com/wp-admin.

Lost Password WordPress

From there, your WordPress site will ask you for your username or email connected to your profile. If you get it right, a new password will be sent to the email address associated with your user. The link in the email will let you reset your password and access your website!

But sometimes, problems arise with this password reset method.

  • We can’t always remember the username or email address associated with our account, especially if we’re used to using something like the WordPress desktop app.
  • Your hosting provider can have issues that cause this reset email not to be sent. If this is happening to you, we recommend moving to a fully managed WordPress hosting environment.

If either of these are the case, take a deep breath. There are other, slightly more technical ways to reset your login password.

2. PhpMyAdmin Password Reset via cPanel

This is useful for people who have phpMyAdmin access into their database. Just follow the steps listed below.

These steps (and screenshots) may vary slightly depending on your hosting provider. If in doubt, ask your hosting provider for support!

    1. Login to phpMyAdmin and click on databases. A list of databases will appear, and you will need to click on the WordPress database of the website you need to reset the password for.

    1. In the table column, look for wp_users and click on the browser icon.

  1. Under the user_login find your username you want to reset the password for and click edit.
  2. Your user_id will appear. Click edit.
  3. Next to the user_pass you will see a long list of letter and numbers. Select and delete this long string.
  4. Type in the new password that you want to use. Remember that it is case sensitive.
  5. Once done, select MD5 from the drop-down menu.
  6. Double check to ensure your the password is correct and that MD5 has been selected.
  7. Save your changes by clicking the Save, Update, or Go button at the bottom of the page

And that should do it! You can now log in through wp-admin with your username and new password.

But if you don’t have access to your website via cPanel, there is also a way to reset your password via FTP.

3. Password Reset via FTP Functions File

Each WordPress theme has a PHP file named functions.php. You will need to download a copy of this file from the WordPress hosting server to your computer through FTP.

You must edit the wp_set_password line of code in order to reset, change or recover your WordPress login password.

The code must be set as wp_set_password (‘abcdef, 1’).

In this code, abcdef is the sample new password (you can use whatever you want here). The number 1 refers to the WordPress users ID number. When changing the password for your site, make sure you use a password you can remember and that you keep somewhere secure.

Make sure to save the edits you made to the functions.php file. With the help of FTP, upload the edited file back to your website.

And you’re done! You should now be able to log into your WordPress website through your /wp-admin dashboard.

Undo the Changes Made to the WordPress Theme File

After you have successfully recovered or changed your password, the next important step is to undo the changes that were made to the theme file of WordPress. For this, you have to download the WordPress functions file once again through FTP and remove the line of code. This code is the same which was used to recover or change the password for your WordPress site. Now, you need to upload the file that you have modified back to your WordPress site through the FTP, and now you’re really done.

Using the FTP or cPanel to recover your WordPress password would require you to identify the WordPress theme that is currently active on your site. If you change the function file in an inactive file, the password will not be recovered! The theme for your WordPress site can be found out from the footer, dashboard or the page source code of WordPress.

4. Emergency Password Reset PHP Script

If all else fails, there’s one final password reset option you can try. This one requires that you create a PHP file from a pre-written script and add it to the core of your website.

Before you try this option, make sure you know who the administrator is. You will need their username and email address in order to do this.

Here are the steps to add the emergency password reset script:

  1. To retrieve the PHP script, copy it from here.
  1. Create a new file called “emergency.php”. Paste the entire script into the file, update the values so the file contains your admin’s information, and save.
  1. Log into your web hosting account and control panel.

Using your FTP or file manager, go to the root of your WordPress website.

Upload Emergency File

Add the new file to the root. Do not place it in the plugin directory. (It was previously called a “plugin”, but should not be treated as such now.

  1. Open a new browser tab and go to: https://[yourdomainname].com/emergency.php.

You’ll be prompted to enter the admin’s username. Then, create a brand new password. Click on “Update Options” when you’re done.

If you used the correct username, your administrator should receive a confirmation email with the new password.

  1. Once the admin has regained access, delete the emergency.php file from your server.

Validate the New Password

After completing any of the above strategies, you should be able to use your new password to log into your WordPress site. Go to your wp-admin login area, enter your admin username and new password and give it a shot. If you can login successfully, it means your new password is now officially active.

Wrapping up

Entering the password each time you log into your WordPress site can be quite bothersome and lead to forgetting your password in the first place! If you’re logging in from secure locations, you can check the Always Remember Me checkbox, especially if you are going to log in from your home device. When you login once to your site, you would remain logged in until and unless you cleared the cookies from the browser.

For an alternative option, you can use a tool like LastPass or 1Password to automatically save new passwords and enter them securely.

Share this post:
Share on twitter
Share on email
Share on facebook
Share on linkedin
Did you enjoy this post? Subscribe for more

Register for our next live WP AMA event!

🏆Chance to win weekly giveaways

📆 Instant invites to our Weekly WP AMA

🙋 First access to submit questions

💻 Direct links to all of our events

WP Buffs, LLC is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please enter your name and email address above.

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy. By clicking submit above, you consent to allow WP Buffs, LLC to store and process the personal information submitted above to provide you the content requested.

Read about how we increased Rigorous Digital's profit margin by 23% and helped remove all website issues for MEP Publishers and their 3 complex websites.

Case study eBook cover (MEP Publishing)
No thanks, I don't need more profit and I can tackle all my WordPress issues myself.
Case study eBook cover (Rigorous Digital)

WP Buffs, LLC is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please enter your name and email address above.

 

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy.

By clicking submit above, you consent to allow WP Buffs, LLC to store and process the personal information submitted above to provide you the content requested.

Which care plans best fit your websites (or client sites)?

✔️ White-label site management

✔️ $1,000+ of premium plugins free under our care plans
✔️ 24/7 website edits and priority support
✔️ Ongoing speed and security optimization
✔️ 24/7 website uptime monitoring
✔️ 4x daily cloud backups
✔️ Weekly plugin, theme and core file updates
✔️ Weekly reports detailing any on-site changes

No thanks. I can manage, speed up, secure, fix and grow websites myself.
Questionnaire
No thanks. I can manage, speed up, secure, fix and grow websites myself.

Schedule a private call with our team to discuss our 24/7 WordPress care plans for serious website owners or 24/7 white-label site management for agencies and freelancers

Finally, a WordPress newsletter you'll actually read every single month.

✔️ High-impact news

✔️ Actionable tutorials and videos

✔️ #WordPress Twitter highlights

✔️ Vote on receipient of $200 donation and WP Buffs merch giveaways

✔️ Fully curated so you only receive the best 5% of content

No thanks, I have other ways to stay updated with WP

WP Buffs, LLC is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please enter your name and email address above.

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy. By clicking submit above, you consent to allow WP Buffs, LLC to store and process the personal information submitted above to provide you the content requested.

Finally, get your website 99.9999% secure and loading in under 1 second.

Our free eBooks and easy-to-follow checklists will have your website fully optimized in just a few hours.

No thanks, my website is as fast and secure as I want it.

WP Buffs, LLC is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please enter your name and email address above.

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy. By clicking submit above, you consent to allow WP Buffs, LLC to store and process the personal information submitted above to provide you the content requested.

How to Sell Your Very First Care Plans Cover

Finally, an email list that helps make WordPress simple and effective for you.

Speed & security optimization tips and detailed how-to guides with advice you can implement today.

No thanks, I already know everything about WordPress.
Speed checklist eBook cover

WP Buffs, LLC is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please enter your name and email address above.

 

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy. By clicking submit above, you consent to allow WP Buffs, LLC to store and process the personal information submitted above to provide you the content requested.

Case study eBook cover (Rigorous Digital)
Case study eBook cover (MEP Publishing)
How to Sell Your Very First Care Plans Cover

Honed and proven strategies we've used successfully 500+ times to help you sell your first care plans. Action steps you can implement in minutes.

No thanks, I can already sell as many care plans as I want.
How to Sell Your Very First Care Plans Cover

WP Buffs, LLC is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please enter your name and email address above.

 

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy.

By clicking submit above, you consent to allow WP Buffs, LLC to store and process the personal information submitted above to provide you the content requested.

No thanks, I'm happy with my MRR

The WPMRR Virtual Summit! A free online conference 100% focused on helping you make monthly recurring revenue work for your WordPress business.

wpmrrvsblue

✔️ Attend every session and panel for free

✔️ Access to live event with all your WP friends

✔️ Free MRR merch giveaways

✔️ WP Buffs donation of $1 per registrant to Lawyers for Good Government

✔️ Make subscription revenue a core part of your business