Can't Log In to WordPress Admin? Password Reset and Login Loop Fix

Short answer
Can't log in to WordPress admin: what should you do first?
When you can't log in to WordPress admin, the wp-admin screen is blocking you because of a password, cookie, site address or plugin problem. First, try a private browser window. Next, use the Lost your password link. If neither works, move on to your hosting panel and fix it through the database or the plugin folder.
If you can't log in to WordPress admin, take a breath first. In most cases you can fix it without breaking anything, and you rarely need to touch code. We are Talha Aslan and team, and in this guide we split the problem into four groups: a forgotten password, a reset email that never arrives, a login loop, and a security plugin lockout. Then we walk you through each fix in order.
The most common mistake in a panic is trying five fixes at once. For example, someone resets the password in the database and disables every plugin at the same time. As a result, they never learn which step actually solved it. So we suggest you follow the order below and retest the login after each step.
- Open wp-login.php in a private or incognito window and try again.
- Try your account email address instead of your username.
- Request a password reset link and check your spam folder.
- If an error message appears, write down its exact wording.
- If nothing works, log in to your hosting panel (cPanel or similar) and continue below.
Which symptom points to which cause?
The fastest fix starts with reading the symptom correctly. After all, "I can't get in" can describe five very different failures. Match what you see on screen with the diagnosis table below. Then jump to the matching section.
| What you see | Likely cause | First thing to try | Access you need |
|---|---|---|---|
| Incorrect password notice | Forgotten or changed password | Password reset link | Your inbox |
| Reset email never arrives | The site cannot send mail reliably | Spam folder, then the database route | Hosting panel |
| Correct password, back to the login screen | Cookie, cache or site URL mismatch | Private window, clear cookies | Browser, then the database |
| Notice that cookies are blocked | The browser cannot store the test cookie | Browser cookie settings | Browser |
| Too many attempts, temporary lockout | Security plugin block | Wait out the lockout | File manager or FTP |
| White screen or critical error | Plugin, theme or PHP failure | Debug mode, disable plugins | File manager or FTP |
| Database connection error | Database credentials or server issue | Check wp-config.php values | Hosting panel |
The last two rows are not really login problems. In those cases the whole site is down, so the dashboard fails too. We cover them in separate guides: fixing the WordPress critical error and the database connection error guide. Here, we focus on cases where the login page loads but will not let you in.
How do you reset a WordPress password by email?
The easiest route is the Lost your password link on the login screen. The official WordPress password reset documentation also lists it first. You enter your username or the email on file, and WordPress sends you a link to set a new password.
- Go to wp-login.php and click the password reset link.
- Enter your username or the email address on the account.
- Use the link in the email to set a new, strong password.
- After you log in, open your profile and confirm the email address is current.
However, people often miss one detail. The reset link goes to the email stored on the account. In other words, if an agency or freelancer built the site years ago, the account may still use their address. In that case, skip the waiting and go straight to the database method. To create a strong password, try our password generator.
Why is the WordPress password reset email not arriving?
When the reset email never shows up, the problem is usually not the password. Instead, it is how the site sends mail. On many servers WordPress sends mail without authentication. Therefore the receiving server may flag it as spam or reject it outright. First, check your spam and promotions folders. Then rule out the causes below.
- The account email may be an old address nobody reads anymore.
- The server may block outgoing mail sent through PHP.
- Your domain may lack SPF or DKIM records, so receiving servers refuse the message.
- A security plugin may limit password reset requests.
The lasting fix is to send site mail through an authenticated SMTP account. We explain the steps in our WordPress SMTP setup guide. Still, you cannot change SMTP settings while you are locked out. So use the database route in the next section first, then fix email delivery.
How do you change a WordPress password in phpMyAdmin?
If email is not an option, the most common method is phpMyAdmin. The official documentation describes it step by step and adds a warning: editing the wrong row can cause data loss. For that reason, download a database backup from your hosting panel before you start.
- Open phpMyAdmin from your hosting panel and select the WordPress database.
- Find the table that ends in users. The default prefix is wp_, but yours may differ.
- Click edit on the row with your username.
- Delete the old value in the user_pass field and type your new password.
- Choose MD5 from the function list on the same row and save.
- Test the new password on the login screen.
According to the documentation, WordPress accepts a password stored this way on the next login. That said, treat it as temporary. Once you are in, change the password again from your profile, so WordPress stores it with its own current method. If you don't know the table prefix, check the table prefix line in wp-config.php.
Who should use WP-CLI to reset a password?
If you have command line access, WP-CLI is the cleanest route. WP-CLI is the official command line tool for managing WordPress. First, you list the users. Then you set a new password for the right user ID with one command. The WP-CLI user update reference lists the options.
For example, wp user list shows each user and their ID. Next, you pass that ID and the user_pass option to wp user update. The reference also notes a skip-email option that stops the notification email. However, many shared hosting plans do not offer terminal access. So this route mostly suits VPS setups or sites with developer access.
WP-CLI has one more advantage. Your commands stay in the shell history, so you can review what you changed later. In addition, you never edit database rows by hand, which lowers the risk of changing the wrong one.
What emergency options exist through FTP or the file manager?
The official documentation describes two file based emergency routes. The first adds a temporary password line to your active theme's functions.php file. Another option is an emergency password reset script placed in the WordPress root folder. Both can leave a security hole if you forget to clean up.
- Per the documentation, the functions.php line resets the password on every page load until you remove it, so delete it right after you log in.
- The emergency script needs the admin username, and you must delete it from the server afterward. Otherwise, anyone could use it.
- Before either method, download a copy of the file you plan to edit.
In our experience, these routes help when you have file manager access but no database access. Still, prefer phpMyAdmin if you can reach it. A single typo in a theme file can take the whole site offline.
Why does WordPress send you back to the login page after a correct password?
This is the WordPress login loop. WordPress accepts the password but does not recognize your session, so it sends you back to wp-login.php. Changing the password again will not help, because the problem lives in how the browser stores your session.
The WordPress cookies documentation explains that login creates two key cookies. One holds authentication details, and the other shows that you are logged in and who you are. In addition, WordPress uses a temporary test cookie to check whether your browser can store cookies. If those cookies fail or land on the wrong domain, the loop begins.
- Delete the site's cookies in your browser and retry in a private window.
- A caching plugin or server cache may have cached the login page, so purge it.
- If the site URL and WordPress URL differ (www vs non-www, http vs https), the cookie ends up on the wrong address.
- A recent plugin or theme update may have broken session handling.
How do you fix a site URL mismatch?
WordPress stores two addresses: the site address visitors see, and the WordPress address where the core files live. The WordPress guide on moving sites and changing URLs says both should include https and should not end with a slash. When one has www and the other does not, cookies stop matching.
Because you are locked out, you cannot fix this on the Settings screen. Instead, pick one of three documented routes. You can edit the siteurl and home rows in the options table through phpMyAdmin. Alternatively, update both options with WP-CLI. Finally, you can add the WP_HOME and WP_SITEURL constants to wp-config.php. The guide notes that once you use the constants, you can no longer edit those fields in Settings.
Example scenario: a site moves to https with a new SSL certificate, but the database still stores the http address. The owner enters the right password and keeps bouncing back. In this scenario, matching siteurl and home on https ends the loop. Always back up the database first.
What if a security plugin locked you out?
After many failed attempts, security plugins block your IP address for a while. That is not a malfunction; it shows the plugin is fighting brute force attacks. So waiting out the lockout is the safest choice. The length depends on the plugin, and WordPress documentation does not set a fixed value.
If you cannot wait, open wp-content/plugins in your file manager and rename only the security plugin's folder. WordPress treats a plugin it cannot find as inactive. Then log in, rename the folder back, and add your own IP address to the plugin's allowlist.
- Disable only the plugin you suspect, not every plugin.
- If a plugin moved your login URL, note the custom address; disabling it restores the default.
- If you lost the phone for two factor authentication, look for the plugin's backup codes.
Where is the wp-admin login URL if you forgot it?
The default login address is yourdomain.com/wp-admin or yourdomain.com/wp-login.php. However, if WordPress lives in a subfolder, the address becomes yourdomain.com/folder/wp-admin. Also, some security plugins move the login page to a custom path, and then the default address returns a 404 error.
If you don't remember the custom address, you have two options. First, ask the person who built the site or search your original setup emails. Second, temporarily rename that plugin's folder to restore the default path. If you are not sure how to reach your hosting panel, our cPanel login URL and port article helps.
Can't log in to WordPress admin but the site loads: which files should you check?
If the front end loads fine but the dashboard rejects you, the cause is likely one setting or file. Start with wp-config.php in the root folder. It holds database details, the table prefix and, if present, the WP_HOME and WP_SITEURL constants. For instance, if someone added those constants with an old address, every login goes to the wrong place.
Next, check the htaccess file in the root folder. Caching and security plugins write redirect rules there. Instead of deleting it, download a copy first. Then rename it temporarily and test the login. If the login works, find the bad rule. If not, restore the original name.
- wp-config.php: URL constants, table prefix and debug setting.
- htaccess: redirect and access restriction rules.
- wp-content/plugins: security, caching and login URL plugins.
- wp-content/themes: forgotten temporary lines in functions.php.
You reach all of these through your hosting file manager or FTP. Still, never edit them without a backup, because one missing character can take the site down.
You can log in, but the dashboard is empty or shows a permission notice: why?
Sometimes the login succeeds, yet you see a dashboard with missing menus or a similar notice saying you lack permission. Usually, this is about your user role, not your password. For example, if your account is an editor or author instead of an administrator, you will not see plugin or settings menus.
To check your role, ask another administrator to open the Users screen. If no admin account exists, the situation is more delicate. Changing a role in the database means editing a serialized value in the usermeta table, and one small mistake can make the account unusable. Therefore, if you have WP-CLI access, change the role from the command line instead.
Also, if you are an administrator but menus are missing, a plugin may be hiding them. Again, the folder rename method shows which plugin is responsible. If an unknown user suddenly has an administrator role, treat it as a security incident.
Why can you log in on your phone but not on your computer?
If the same password works on one device and fails on another, the problem is almost always in the browser. After all, the password and database are identical for both devices. Only stored cookies, extensions and saved passwords differ. So rule out the browser before you change anything on the server.
- The browser may autofill an outdated saved password, so type it by hand.
- An ad blocker or privacy extension may block cookies.
- A corporate firewall may restrict the wp-admin path.
- If you use a VPN, a security plugin may have blocked that IP address.
For example, if you fail at the office but succeed at home, ask your network admin whether wp-admin is blocked. In short, narrow the problem from device to network to server, and you will save the most time.
What should you ask your hosting provider's support team?
If you are locked out of both WordPress and the hosting panel, your hosting support team is the first stop. However, they cannot know your WordPress password. They can only grant access after confirming you own the account. So open a clear ticket with details they can verify.
- Prepare the account holder's name, email and billing details.
- Ask them to reset your hosting panel password or grant you new access.
- Ask whether a server side security rule blocks the login path.
- Find out when the latest backups ran and how restores work.
Also, never send passwords in plain text in a ticket. Ask them to grant access through their own panel tools instead. That way, you don't create a new risk while fixing the old one. Once you have access, continue with the phpMyAdmin or WP-CLI steps above, then test the login in a second browser before closing the ticket.
When can you fix it yourself, and when should you get help?
Forgotten passwords and cookie loops are problems most owners can fix alone. However, editing database tables, adding URL constants or disabling security plugins takes care. Editing the wrong table or working without a backup can turn a small login issue into a full outage.
We use a simple rule. If you have no hosting access, don't know who built the site, or the problem returns within the same week, hand it to a professional. For businesses that want the foundation rebuilt cleanly, our web design services include an admin panel and handover documentation.
- Do it yourself: private window, password reset, cookie and cache cleanup.
- Do it carefully: phpMyAdmin password change, plugin folder rename.
- Hand it off: unknown admin accounts, a changed email, repeated lockouts.
Does a login problem mean your site was hacked?
Not every login problem is an attack, but some signs deserve attention. For example, your unchanged password suddenly fails, an unknown administrator appears in the user list, or someone switched the admin email. In those cases, treat it as a security incident.
- Check the users table in phpMyAdmin for admin accounts you don't recognize.
- Review file modification dates in your hosting panel.
- Look for strange redirects or ads on the public site.
If you see any of these, changing the password alone is not enough, because the attacker will come back through another door. Our WordPress site hacked guide walks you through cleanup. Afterward, rotate every admin password and the database password too.
How do you avoid getting locked out of WordPress admin again?
Most lockouts are preventable. First, set the admin email to a permanent company address that more than one person can reach. That way, reset emails still land in the right place after staff or agency changes. In addition, sending site mail through SMTP keeps reset messages out of spam.
- Give every user a separate account and never share one admin password.
- Store credentials in a team password manager.
- Keep two factor backup codes somewhere safe.
- Keep hosting and database access registered to the site owner.
- Back up regularly and test a restore at least once.
To organize shared credentials, read our guide on choosing a team password manager. And if you are curious about passwordless sign in, see what a passkey is.
Example scenario: the agency left and nobody can log in
Example scenario: a service business parts ways with the freelancer who built its site. A few months later, the marketing lead can't log in, and reset emails go to the freelancer's address. At first, the owner considers rebuilding the whole site.
The fix is simpler. The business gets access to the hosting panel that is registered in its own name. Next, it replaces the admin email in phpMyAdmin with a company address and sets a temporary MD5 password. After logging in, it changes the password, removes the old user and sets up SMTP.
The lesson: the domain, hosting and admin account should belong to the business. We cover ownership questions in who owns your website source code.
What are the most common mistakes?
What makes a login issue worse is usually the rushed fix, not the issue itself. In our experience, these mistakes come up most often:
- Editing the database without a backup.
- Forgetting to remove the password line from functions.php.
- Leaving the emergency reset script on the server.
- Disabling every plugin at once and losing track of the culprit.
- Adding WP_HOME and WP_SITEURL with the wrong address, which redirects the whole site.
- Handing panel access to strangers who offer paid "account unlocking".
The last point matters most. Share admin access only with people you trust and work with under a contract. Otherwise, you may hand your site to someone else while trying to fix a login. For the wider picture, see our website data security guide.
Quick checklist when you can't log in to WordPress admin
Print this list and keep it handy. When you can't log in to WordPress admin, go through it in order and retest after each step.
- Try a private window and a second browser.
- Try logging in with your email address.
- Request a reset email and check spam.
- Clear cookies and cache.
- Download a database backup from your hosting panel.
- Reset the password through phpMyAdmin or WP-CLI.
- Confirm siteurl and home use the same format.
- If a security plugin locked you out, wait or rename its folder temporarily.
- Once inside, review the email address, the user list and SMTP settings.
Should you switch from WordPress to a custom built site?
Some businesses with frequent login trouble start questioning the platform. WordPress is popular, flexible and backed by a large community. Still, maintenance grows with every plugin you add. So the decision depends on how often the site changes and who maintains it.
Before deciding, read our WordPress vs custom website comparison. Whichever you choose, one rule stays the same: you hold the access details, and you keep regular backups.
If managing the site yourself feels like too much
Login problems often point to deeper disorder. Nobody knows who owns which account, backups are missing, and email delivery was never set up. On web projects, we prefer to build that order from day one. Our scope covers information architecture, brand specific design, speed and Core Web Vitals, SEO foundations, and an admin panel where you edit text and images yourself.
We document the build so another developer could take it over, and the domain is always registered in your name. That way, a team change never leaves you locked out. If you want your site rebuilt this way, see the scope and process on our corporate website design page.



