How to Reset a WordPress Admin Password (5 Ways, Even Without Email)

Locked out of WordPress, or just need to change the password on an admin account? There are five reliable ways to reset a WordPress admin password, from the one-click email link to database-level resets that work even when nothing else does. Start with Method 1 and move down the list; each method works in situations where the previous one fails.

Method 1: Reset Your Password via Email (Lost Password Link)

The fastest way to reset your WordPress password when you can't log in:

  1. Go to your login page (yoursite.com/wp-login.php) and click Lost your password?
  2. Enter your username or the email address on the admin account.
  3. WordPress sends a password reset link to that email, click it and choose a new password.

If the reset email never arrives, check spam first, then your site's ability to send email at all, many servers can't send mail without an SMTP plugin. If email is broken, use one of the methods below, then fix deliverability so future resets work.

Method 2: Change the Password from the WordPress Dashboard

Already logged in (or another administrator is)? Changing your WordPress password takes a minute:

  1. Go to Users → Profile (or Users → All Users → pick the admin user).
  2. Scroll to Account Management → Set New Password.
  3. WordPress generates a strong password, use it or type your own, then click Update Profile.

An administrator can reset the password for any user this way, handy when a team member is locked out and email reset isn't working for them.

Method 3: Reset the Password via phpMyAdmin (Database)

When you can't receive the reset email and no other admin exists, reset the password directly in the MySQL database using phpMyAdmin:

  1. Open phpMyAdmin from your hosting control panel (cPanel, hPanel, Plesk) and select your site's database.
  2. Open the wp_users table and click Edit on the admin user's row.
  3. In the user_pass field, paste your new password and select MD5 in the Function dropdown.
  4. Click Go, the new password works immediately (WordPress upgrades the MD5 hash to its stronger format on your next login).

Tip: your table prefix may differ (e.g. wp7a_users instead of wp_users). Always back up the database before editing it.

Method 4: Reset via WP-CLI (Command Line)

If you have SSH access, WP-CLI is the cleanest server-side reset. List users to find the right ID, then update the password:

wp user list wp user update 1 --user_pass="your-new-strong-password"

Replace 1 with the admin user's ID. This bypasses email entirely and takes effect instantly, the go-to method for developers and agencies managing many sites.

Method 5: Reset from cPanel / Softaculous

If your host installed WordPress through Softaculous, you can change the admin password without touching the database: open Softaculous in cPanel, find your WordPress installation, click Edit Details, and set a new Admin Password. Some hosts (Hostinger, SiteGround, Bluehost) also offer their own one-click password reset in the hosting panel, worth checking before editing the database by hand.

When the Reset Email Never Arrives

A missing reset email is the most common reason people end up locked out. Work through these before assuming the account is broken:

  • Check spam and promotions folders, and search your inbox for "wordpress" in case a filter hid the message.
  • Confirm the admin email is correct. If the address on the account is old or wrong, the link goes nowhere. Verify or change it with the dashboard method above, or in the database (wp_users). See how to change the WordPress admin email.
  • Test whether the site can send mail at all. Many servers cannot send email out of the box, so no WordPress notification arrives. Installing an SMTP plugin and sending through a real mail service (your host, Gmail, SendGrid, Brevo) fixes it for good.
  • Reset another way in the meantime. Use phpMyAdmin, WP-CLI, or the code method below to get back in now, then fix deliverability so future resets and notifications work.

Advanced: Reset the Password with Code

If you have file access but no database tool or SSH, you can force a reset with a short PHP snippet. Add this to your theme's functions.php (or a small plugin), load any page of your site once, then remove the line immediately:

// Temporary: set user ID 1 to a new password, then DELETE this line. wp_set_password( 'your-new-strong-password', 1 );

The wp_set_password() function hashes the password correctly and clears the old one. Because it runs on every page load, you must remove the snippet as soon as you can log in, or WordPress will keep resetting the password and trap you in a loop.

The Emergency Password Reset Script

For the worst case (no admin access, no database tool, and email is down), WordPress.org publishes a standalone Emergency Password Reset script. You place emergency.php in your site root, open it in the browser, enter the admin username and a new password, then delete the file the moment it finishes. It does not check who is running it, so leaving it in place is a serious security hole. See the official reset your password documentation for the current script.

After the Reset: Lock the Door Properly

A password reset is a good moment to harden the login itself. Use a unique, generated password (a password manager beats memorable phrases), enable two-factor authentication if your security plugin offers it, and consider changing your WordPress login URL so bots can't hammer wp-login.php. If you manage client sites, role-based login redirects also keep users away from screens they don't need. WP Adminify's security module covers both without extra plugins.

WordPress Admin Password FAQs

How do I reset my WordPress admin password without email access?

Use phpMyAdmin (edit the user_pass field in wp_users with the MD5 function), WP-CLI (wp user update), or Softaculous in cPanel. All three work with no email involved.

Why is my WordPress password reset email not arriving?

Usually the server can't send mail. Check spam first, then install an SMTP plugin so WordPress sends through a real mail service. Until that's fixed, reset via the database or WP-CLI instead.

Can I change another user's password as an administrator?

Yes, go to Users then All Users, edit the user, and use Set New Password under Account Management. The change applies immediately and logs out that user's active sessions if you also click Log Out Everywhere.

Is editing the database to reset a password safe?

Yes, if you change only the user_pass field with the MD5 function and back up the database first. WordPress automatically re-hashes the password with its stronger algorithm the next time you log in.

How do I reset a WordPress password using functions.php?

Add wp_set_password( 'new-password', 1 ); to your theme's functions.php, where 1 is the user ID, then load any page of your site once. Delete the line immediately afterward, or WordPress resets the password on every request and locks you out again.

What is the WordPress emergency password reset script?

It is a standalone emergency.php script from WordPress.org that resets the main admin password when you have no dashboard, database, or email access. You upload it to the site root, run it once in the browser, then delete it right away because it performs no permission checks and is unsafe to leave online.

The reset link says it has expired or is invalid. What now?

Reset links are single-use and expire after 24 hours, so request a fresh one from the Lost your password page and use the newest email. If the new link still fails or no email arrives, the site likely cannot send mail, so reset through phpMyAdmin, WP-CLI, or the code method instead.

Related Reading

Get notified about Updates & Offers

Subscribe to get Updates & Offers

You Might Also Like:

Coupons