If you can’t log in to WordPress because you’ve forgotten your password, you can reset it in a few minutes. The easiest way is the built-in lost password link, but that depends on your site being able to send email.
Below are four ways to reset a WordPress password, from easiest to most technical. Start at the top and move down only if a method doesn’t work for you.
1. Use the “Lost your password?” link
This is the normal way, and it works on any WordPress site that can send email.
- Go to your login page, usually
yoursite.com/wp-login.phporyoursite.com/wp-admin. - Click Lost your password? under the login form.
- Enter your username or the email address on your account and click Get New Password.
- Open the email WordPress sends you and click the reset link.
- Enter a new password and click Save Password.
The reset link expires after a while, so use it soon after it arrives. If the link says it is invalid or expired, request a new one.
If the email never arrives, check your spam folder first. If it still isn’t there, your site probably isn’t sending email reliably, which is common. Use one of the methods below to get in, then fix your email afterwards.
If the login page itself loads an old version or the reset form behaves strangely, a page cache may be serving a stale copy. Our guide on how to clear WordPress cache covers that.
2. Ask another administrator to reset it
If someone else on your site has an Administrator account, they can reset your password from the dashboard without any email involved.
- They go to Users → All Users and click your username.
- They scroll down to the Account Management section and click Set New Password.
- WordPress suggests a strong password. They can use it or type their own.
- They click Update User at the bottom of the page and send you the new password through a secure channel.
There is also a Send password reset link that appears when you hover over a user in Users → All Users. That sends the same email as the lost password form, so it only helps if your site’s email works.
Once you are logged in, change the password to one only you know under Users → Profile.
3. Reset it in phpMyAdmin
If email doesn’t work and nobody else has admin access, you can set the password directly in the database. Most hosting control panels include phpMyAdmin for this. Take a backup before editing the database, or at least export the users table.
Find the right database and table
If your hosting account has more than one database, open wp-config.php in your site’s root folder and look for the DB_NAME line. That is the database your site uses.
In the same file, look for $table_prefix. It is usually wp_, but it can be something else, like wpx7_. Your users table is that prefix followed by users, for example wp_users.
Change the password
- Open phpMyAdmin and select your site’s database in the left column.
- Click the users table, for example
wp_users. - Find your account by the
user_loginoruser_emailcolumn and click Edit on that row. - In the
user_passrow, select MD5 from the Function dropdown. - Delete the long string in the Value box and type your new password in plain text.
- Click Go at the bottom to save.
You can now log in with the new password.
You might wonder why this uses MD5, since MD5 is not secure for storing passwords. WordPress no longer creates MD5 hashes itself, but it still accepts one in that field for exactly this kind of recovery. The first time you log in, WordPress checks the password against the MD5 hash and then replaces it with a modern, secure hash automatically. The weak hash only exists until your next login, so log in straight away.
4. Reset it with WP-CLI
If you have SSH access and WP-CLI is installed, which is common on managed and developer-friendly hosting, this is the fastest method. Connect over SSH and move into your site’s folder first.
List the administrator accounts so you have the right username or ID:
wp user list --role=administrator --fields=ID,user_login,user_email
Then set a new password for that user. Replace admin with the username or ID from the list:
wp user update admin --user_pass='your-new-password'
WP-CLI hashes the password properly, so there is no MD5 step. Be aware that the password will be saved in your shell history. After logging in, change it again from Users → Profile, or clear that line from your history.
If you would rather have WordPress email a reset link, this command sends one:
wp user reset-password admin
As with the lost password form, that only helps if your site can send email.
If the reset worked but you still can’t log in
If you’ve set a new password and the login page still refuses it or sends you back to the login screen, the password probably isn’t the problem. Common causes:
- A security plugin has locked out your IP address after failed attempts. Wait for the lockout to expire, or temporarily disable the plugin by renaming its folder in
wp-content/pluginsover FTP or your host’s file manager. - Cookies or a cached login page. Try a private browser window.
- A plugin conflict on the login page. Our guide to troubleshooting plugin conflicts walks through isolating it.
After you’re back in
- Check Users → All Users for administrator accounts you don’t recognize. An unknown admin, or a password that changed without you doing it, is a sign the site may be compromised. See our guide on what to do with a hacked WordPress site.
- Use a password manager so you aren’t locked out next time.
- Make sure the email address in Users → Profile is one you still have access to.
- If the reset email never arrived, fix your site’s email now. Password resets, order emails and form notifications all depend on it.
Still stuck?
If you’re locked out and none of these methods are practical for you, our $79 one-time fix will get you back into your dashboard and check that nothing else is wrong. It’s fixed or your money back, usually within 24 hours.