The password reset email never arrives
Either sending the email fails, or it goes to a different address than you think. Here is how to set a new password anyway.
- You need
- Hosting panel
- Updated
When you click "Lost your password?", WordPress sends an email with a link for choosing a new password. If that email never arrives, either sending fails or the email address on your account isn't the one you think. Your account exists, or WordPress would have shown an error.
Many WordPress sites send email straight from the web server, without SMTP. Those messages often land in spam or are rejected by the receiving mail server, and if the server isn't set up to send email, they aren't sent at all. You can still set a new password without the email.
Check your inbox and the address
- Look in the spam folder and in every tab of your inbox. The link in the email is valid for 24 hours.
- Check that you're using the email address set on your WordPress account. It may be an old address or the address of whoever built the site.
- If you get "Error: There is no account with that username or email address.", try your username instead.
- If you get "Error: The email could not be sent.", WordPress couldn't send the email at all.
When WordPress tells you to check your email for the confirmation link, it only means the server accepted the email for sending. It doesn't tell you whether it arrived.
Ask another administrator for help
If the site has another administrator, they can set a new password for you directly in WordPress. Then you don't need the email with the link.
- Go to Users → All Users and click your username.
- Click "Set New Password" under Account Management, and type a new password.
- Click "Update User". The new password works immediately.
Set the password in the database
If you're the only administrator, you can change the password in the database with phpMyAdmin, which most hosting panels include.
- Open phpMyAdmin and select the database set as
DB_NAMEinwp-config.php. - Open the
wp_userstable. If the site uses a prefix other thanwp_, it's set as$table_prefixinwp-config.php. - Find your user in the
user_logincolumn and edit the row. - Delete the contents of the
user_passfield and type your new password. ChooseMD5in the function list on the same line. - Save, and log in with the new password.
MD5 is a weak hash, but the first time you log in, WordPress rehashes the password with a stronger algorithm. From WordPress 6.8 that is bcrypt.
With SSH and WP-CLI, two commands are enough. The first lists the users with their IDs, and the second sets the password for the user with ID 1:
wp user list
wp user update 1 --user_pass=new-password
To keep the password out of your shell history, use --prompt=user_pass instead of --user_pass=new-password. WP-CLI then asks for the password.
Still locked out?
If the site has no other administrator and you have no access to the hosting panel or WP-CLI, you can't change the password yourself. Whoever holds the hosting account has to give you access or change the password for you.
Get email working
Once you're back in, fix email delivery from the site. Forms, order confirmations and notifications from WordPress go out the same way, so the same problem stops them too.
- Install an SMTP plugin, for example WP Mail SMTP, and connect it to the email account or email service for your domain.
- Click "Lost your password?" on the login page again, and check that the email reaches your inbox and not the spam folder.
- Check that your domain has SPF and DKIM records in DNS for the service you send through. The email service tells you which records it needs, and in MXToolbox you can look up the records your domain has now. The DKIM lookup also needs a selector name, which you get from the email service.
If the email still doesn't arrive, someone who knows email configuration has to check the domain's DNS records and the settings in the SMTP plugin.