If you are locked out of your WordPress dashboard, there is almost always a way back in. This guide covers every method for resetting a WordPress admin password on your Ultra Web Hosting account, in the order you should try them: the built-in email reset link, changing it from inside the dashboard, resetting it directly in the database with phpMyAdmin when you are fully locked out, and using WP-CLI over SSH. It also covers the most common snag, not receiving the reset email, and how to secure the account once you are back in.
Try the Email Link First, the Database Last
Most password resets take 30 seconds through the normal login screen. Only reach for the database when email is not an option.
- Click
Lost your password?on the login screen and follow the emailed link - If you are already logged in, change it under Users in the dashboard
- If you cannot log in and the email never arrives, reset it in phpMyAdmin
- If you have SSH access, one WP-CLI command does it instantly
Which One Applies to You?
The fastest path depends on how locked out you actually are. Start at the top of this list and drop down only when a method does not fit your situation.
- Know the password, just changing it: use the dashboard, Section 04
- Forgot it but email works: use the email link, Section 02
- Email never arrives or the admin address is wrong: phpMyAdmin, Section 05
- Comfortable on the command line: WP-CLI over SSH, Section 06
01. Before You Start: Back Up First
Two of the methods below edit your database directly. That is safe when done correctly, but a mistake in the wrong table can break your site, and there is no undo button. Before you touch phpMyAdmin or run any SQL, export a copy of your database so you can restore it if something goes wrong.
In cPanel, open phpMyAdmin, select your WordPress database in the left column, click the Export tab, and download the .sql file. This takes a few seconds and gives you a clean copy to restore from. A full account backup through the cPanel Backup Wizard is better still. Every Ultra Web Hosting plan keeps automatic backups you can roll back to as well, covered in our guide on backing up your website (ID 467).
If you are only using the email link (Section 02) or the dashboard (Section 04), no backup is needed, since neither one edits the database by hand.
02. Method 1: The Lost Your Password Email Link
This is the method WordPress is built around, and it works whenever you can still receive email at your admin address. It is the right first try for almost everyone.
- Go to your login screen at
yourdomain.com/wp-login.php(oryourdomain.com/wp-admin, which redirects there). - Click the Lost your password? link below the login form.
- Enter your username or the email address on the account and submit.
- WordPress emails you a reset link. Open it, choose a strong new password, and save.
- Log in with the new password.
The reset link is single use and expires after about a day. If it has gone stale, just request a new one. If the link opens a page that says the key is invalid, request a fresh email rather than reusing an old link from your inbox.
03. Not Getting the Reset Email?
This is the single most common reason people end up resetting a WordPress password the hard way. WordPress sends its reset mail through the server's PHP mailer, and several things can quietly stop it from arriving. Work through these before giving up on the email method.
- Check spam and junk. WordPress system mail often lands there. Search your mailbox for the sender
[email protected]. - Confirm the admin email is correct. If the address on the account is old or wrong, the reset goes to an inbox you cannot read. You cannot see or fix this from the login screen, which is exactly why Section 05 (phpMyAdmin) exists.
- Deliverability. If the site sends mail from a domain whose SPF, DKIM, and DMARC records are not set up, receiving providers may silently drop it. An SMTP plugin that sends through a real mailbox is the reliable long-term fix for all WordPress mail, not just password resets.
If the reset email is missing because the admin address itself is wrong, do not fight the email system. Jump straight to phpMyAdmin in Section 05, where you can reset the password and correct the admin email address in the same session.
04. Method 2: Change It From Inside the Dashboard
If you are still logged in and simply want to set a new password, or an administrator needs to reset the password for another user, you never need the database at all. Do it from the dashboard.
To change your own password:
- In the WordPress admin, hover the account name at the top right and click Edit Profile (or go to Users > Profile).
- Scroll to the Account Management section and click Set New Password.
- Accept the strong password WordPress suggests, or type your own, then click Update Profile.
To reset another user's password (administrators only):
- Go to Users > All Users and click the user you need to reset.
- In Account Management, click Set New Password and set it.
- Click Update User. Optionally tick Send the user notification so they get the new credentials by email.
05. Method 3: Reset Through phpMyAdmin
This is the method for when you are fully locked out: you forgot the password, and the reset email never arrives or goes to an address you no longer control. Because it writes a new password straight into the database, it does not depend on email at all. This is the most reliable fallback.
First, find which database your site uses. Open wp-config.php in cPanel File Manager and note the DB_NAME value, and the table prefix:
define( 'DB_NAME', 'user_wp123' );
$table_prefix = 'wp_';
Most installs use the wp_ prefix, so the users table is wp_users. If your prefix is different, for example wpab1_, your table is wpab1_users and you must substitute that everywhere below.
- In cPanel, open phpMyAdmin.
- In the left column, click the database name you found in
wp-config.php. - Click the SQL tab at the top.
- Run this statement, replacing the new password and the username with your own:
UPDATE wp_users SET user_pass = MD5('NewPassword123')
WHERE user_login = 'admin';
Click Go. You should see "1 row affected." Now log in at yourdomain.com/wp-login.php with the new password.
WordPress stores passwords as a salted hash, not as MD5, so this looks wrong at first glance. It is not. WordPress recognizes a plain MD5 value, accepts it for the next login, and automatically re-saves the password using its own stronger hashing the moment you log in. You never need to run the hashing yourself. This is a long-standing, supported behavior.
If you are in phpMyAdmin because the admin email was wrong, fix it in the same place. The address lives in the same row:
UPDATE wp_users SET user_email = '[email protected]'
WHERE user_login = 'admin';
The WHERE user_login = 'admin' clause is what limits the change to one account. Do not omit it, or you will overwrite the password on every user at once. If you are not sure of the exact username, browse the wp_users table first (click the table name, then Browse) and read the user_login column before running the update.
06. Method 4: Reset With WP-CLI Over SSH
If your plan has SSH access and WP-CLI is available, this is the fastest method of all: one command, no database editing by hand, and WordPress does the correct hashing for you. SSH access is covered in our guide on connecting to your account over SSH (ID 60).
Connect over SSH, change into your site's document root (usually public_html), and run:
cd ~/public_html
wp user list
wp user update admin --user_pass='NewPassword123'
wp user list shows the usernames and their roles so you target the right account. wp user update then sets the new password, hashed properly by WordPress. You can target a user by login name or by numeric ID.
If wp is not found, WP-CLI may not be installed for your account. The phpMyAdmin method in Section 05 works on every plan and needs no command line, so use that instead. If you believe WP-CLI should be available and it is not, open a ticket and we will check it for you.
07. Emergency Method: A Temporary Snippet
There is one more fallback for the rare case where you can edit your theme files but cannot reach phpMyAdmin or SSH. It forces a password on next page load, then must be removed immediately. Treat it as a last resort.
- In cPanel File Manager, edit your active theme's
functions.php(underwp-content/themes/your-theme/). - Add this line just after the opening
<?phptag, changing the password and username:
wp_set_password( 'NewPassword123', 1 );
The 1 is the user ID, which is the first administrator on most sites. Save the file, then load any page of your site once so the code runs. Log in with the new password.
This line resets the password on every single page load while it is present, which means you can never stay logged in and anyone hitting your site re-triggers it. The moment you have logged in, go back and delete the line, then save functions.php again. Leaving it in place will lock you back out.
08. After You Regain Access: Lock It Down
Getting back in is half the job. If you were locked out because the password was guessed, or you are not sure why it changed, spend five minutes closing the gap so it does not happen again.
- Use a strong, unique password. Let WordPress generate one and store it in a password manager. Reused passwords are the most common way admin accounts fall.
- Confirm the admin email is correct under Settings > General and Users, so the email reset works next time.
- Check for users you do not recognize. An unexpected administrator account can mean the site was compromised rather than simply forgotten. If you find one, work through our guide on fixing a hacked WordPress site (ID 478).
- Harden logins. Limit login attempts and consider two-factor authentication. Our complete WordPress hardening guide (ID 309) walks through the full checklist.
Resetting a WordPress login changes only who can get into the WordPress dashboard. It is separate from your cPanel password, your email account passwords, and your billing login. If you are trying to reset one of those instead, see our guide on changing your cPanel password (ID 73).
Still Locked Out?
If none of these methods get you back in, our support team can reset the password on the server and check whether anything else is wrong with the install. Send us your domain and the username you are trying to recover.
Open a Support TicketQuick Recap: Resetting a WordPress Password
If you only remember a few things from this guide, remember these:
- Try the email link first with Lost your password? on the login screen.
- If the email never arrives, check spam, then suspect a wrong admin email address.
- Already logged in? Change it under Users > Profile, no database needed.
- Fully locked out? Reset it in phpMyAdmin with an
UPDATE wp_usersstatement, and back up the database first. - Afterward, set a strong unique password, fix the admin email, and check for unknown users.
Last updated November 2026 · Browse all WordPress articles
