How to Recover a Lost WordPress Password (Without Panicking)

It happens to everyone. You go to log into your WordPress site, and the password you know is correct gets rejected. Or your password manager didn’t sync. Or you inherited a site from a former employee who never shared the credentials.

The good news: WordPress has several built-in recovery paths, plus a few manual ones for when those fail. Here’s how to get back in, calmly and without breaking anything.

Option 1: Use the “Lost Your Password?” Link (Try This First)

This is the easiest method, and it works for most people.

  1. Go to your WordPress login page (yoursite.com/wp-admin or yoursite.com/wp-login.php)
  2. Click “Lost your password?”
  3. Enter your username or email address
  4. Check your inbox for the reset email
  5. Click the link and set a new password

If the email never arrives, check these before trying anything else:

  • Spam and junk folders: WordPress password reset emails often land there
  • Your email address: make sure you’re entering the one tied to your account, not a business alias
  • Email delivery: if you’re using a generic sender like wordpress@yoursite.com, your host may be blocking it. Contact your host or use an SMTP plugin

Option 2: Reset via WP-CLI (If You Have SSH Access)

If your hosting provides SSH access, WP-CLI is the fastest method:

bash

wp user update admin --user_pass="YourNewStrongPassword"

That’s it. Log in with the new password immediately.

To list users first (if you’re unsure of the username):

bash

wp user list

Option 3: Reset via phpMyAdmin (When Email Fails)

If password reset emails aren’t arriving and you don’t have SSH access, you can reset the password directly in the database.

Step 1: Access phpMyAdmin
Log into your hosting control panel (cPanel, Plesk, etc.) and open phpMyAdmin.

Step 2: Find your users table
Select your WordPress database, then click on the wp_users table. The prefix may differ (wp2_users, myprefix_users), but it always ends in _users.

Step 3: Edit the password field

  1. Find the row for your user account
  2. Click Edit next to it
  3. In the user_pass field, delete the existing value
  4. Type your new password
  5. In the Function dropdown menu (to the left of the value field), select MD5
  6. Click Go to save

Important: WordPress normally hashes passwords using a stronger method than MD5. Using MD5 here will work for login, but WordPress will automatically re-hash your password to the more secure standard the next time you log in.

Step 4: Log in
Use your username and the new password you just set. Then change it again from the WordPress admin to ensure it’s properly hashed.

Option 4: Reset via functions.php (Last Resort)

If you can’t access the database or your email, you can force a password reset by editing your theme’s functions.php file via FTP or your hosting file manager.

Warning: This method requires care. A syntax error in functions.php can break your site.

  1. Connect via FTP or open your hosting file manager
  2. Navigate to /wp-content/themes/your-active-theme/
  3. Open functions.php
  4. Add this code at the very end:

php

wp_set_password( 'YourNewStrongPassword', 1 );

Replace 1 with your actual user ID (usually 1 for the main admin).

  1. Save the file
  2. Log in with the new password
  3. Immediately remove the code and save the file again

This works because wp_set_password() runs when the file loads, updating the password directly.

Option 5: Reset via Your Hosting Dashboard

Many managed WordPress hosts include a password reset tool in their dashboard.

  • Kinsta: Use the “Reset WordPress Password” option in MyKinsta
  • WP Engine: Available in the user portal
  • Cloudways: Access via the application settings
  • cPanel-based hosts: Often have a WordPress Toolkit with password reset

Check your host’s documentation first, this is often faster than any manual method.

If You’re Locked Out Entirely

Sometimes the problem isn’t the password, it’s that you can’t even reach the login page.

If you’re getting a white screen or 500 error:
The issue isn’t your password. Your site is broken. See our guides on disabling plugins via phpMyAdmin or fixing the “Unable to Create Directory” error.

If you’re seeing “Too many redirects”:
Check your SSL settings. Your site may be stuck in a redirect loop between HTTP and HTTPS.

If someone else changed the password:
If this is a site you own but someone else manages, contact them first. If they’re unresponsive and you own the hosting account, use the phpMyAdmin method above.

After You’re Back In: Secure Your Account

Getting back in is step one. Making sure it doesn’t happen again is step two.

  • Use a password manager (Bitwarden, 1Password, LastPass) so you never rely on memory alone
  • Enable two-factor authentication (2FA) for all admin accounts
  • Ensure you have a working email address attached to your account, this is your recovery lifeline
  • Add a backup admin account with a different email in case one fails
  • Store credentials securely if you manage client sites, never in a shared document

Final Thoughts

A lost password feels like a crisis, but it rarely is. WordPress gives you multiple ways back in, from the simple reset link to direct database access.

Try in this order:

  1. The “Lost your password?” link
  2. Your hosting dashboard’s reset tool
  3. WP-CLI (if you have SSH)
  4. phpMyAdmin (the MD5 method)
  5. functions.php (only if nothing else works)

And once you’re back in, take five minutes to set up 2FA and a password manager. Future you will be grateful.

Was this post helpful?
Buy us a coffee!
Tags:

Free eBook!

Subscribe to our newsletter to receive it free!