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:
- Go to your login page (yoursite.com/wp-login.php) and click Lost your password?
- Enter your username or the email address on the admin account.
- 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:
- Go to Users → Profile (or Users → All Users → pick the admin user).
- Scroll to Account Management → Set New Password.
- 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:
- Open phpMyAdmin from your hosting control panel (cPanel, hPanel, Plesk) and select your site’s database.
- Open the wp_users table and click Edit on the admin user’s row.
- In the user_pass field, paste your new password and select MD5 in the Function dropdown.
- 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.
