How to Fix the WordPress Login Loop (wp-admin Keeps Redirecting to wp-login.php)
You enter the right password and land back on wp-login.php, or see “Cookies are blocked”. Trace the auth cookies, then fix URL, HTTPS proxy, cache and session problems.
Locked out of WordPress, the hosting panel, the registrar or email, or a former developer has the logins.
Do this first
Diagnose it
"Locked out" covers five different doors: WordPress, the hosting account, the domain registrar, email, and a person who holds the keys. Work out which door is shut before you start resetting passwords, because a reset email that goes to a mailbox you cannot open only locks you out further.
| What you see | What it usually means |
|---|---|
Error: The password you entered for the username ADMIN is incorrect. | The username exists and the password is wrong, or someone changed it. |
Error: The username ADMIN is not registered on this site. | The account was deleted or renamed, you are on the wrong site (staging or an old copy), or the database prefix changed. |
| The reset email never arrives | The account email is an old or someone else’s address, or the site cannot send mail. |
| A message about too many failed login attempts, or a blocked IP | A security plugin or the server firewall locked out your IP address. |
| Asked for a two-factor code you can no longer get | Lost phone or authenticator app, and no backup codes. |
Sorry, you are not allowed to access this page. after logging in | Your role was changed, or user roles do not match the table prefix after a migration. |
| Admin users you did not create, or your email changed on your account | A compromise. Treat it as a hack, not a lockout. |
| Hosting, registrar or DNS login tied to a former developer’s email or card | You do not control the account, even if you pay for the site. See former designer has my domain or logins. |
| The site and email went down, and the domain now shows nameservers you do not recognize | Possible domain hijack. See domain hijacked. |
| Mail app keeps asking for the password, and webmail rejects it too | The mailbox password was changed, or the account was locked after a compromise. |
1. Find out who controls the domain.
whois example.com | grep -iE 'registrar:|expir|status|name server'
Run it in your own computer’s terminal (macOS and Linux have whois; on Windows use the domain lookup tool). Replace example.com with your domain. It prints the registrar, the expiry date, the status codes and the nameservers. Good: a registrar you have a login for, a future expiry date, and nameservers you recognize. Bad: a registrar nobody in the business has an account with, an expiry date in the past, or nameservers that changed without anyone asking.
2. See where DNS is actually hosted.
dig +short NS example.com
Run it on your own computer (Windows: nslookup -type=NS example.com). The names it prints show which company runs your DNS, for example a host, Cloudflare or the registrar. You need a login there to change any record, including the ones for email.
3. List the real administrators.
wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
Run it in an SSH terminal inside the site’s folder (the one that contains wp-config.php). --role=administrator shows only admins; --fields picks the columns. Good: names and email addresses you recognize. Bad: an admin you never created, a recent user_registered date nobody can explain, or your own account showing an email address that is not yours. Bad means stop and follow the hacked site steps first.
4. Set a new password without email.
wp user reset-password YOUR_USERNAME --skip-email --show-password
Run it in the same SSH terminal. YOUR_USERNAME is the user_login from check 3. --skip-email stops WordPress emailing the reset, and --show-password prints the new random password on screen, so this works even when mail is broken. Copy it into your password manager, then log in. If there is no SSH, your hosting panel's WordPress manager or phpMyAdmin can do the same; the locked out field guide shows how.
5. Look for a security plugin that is blocking you.
wp plugin list --status=active --fields=name,version | grep -iE 'wordfence|limit|login|security|solid|two-factor|2fa'
Run it in the same terminal. grep -iE filters the list for names that usually belong to login protection or two-factor plugins. If one shows up and you are locked out by it, wp plugin deactivate PLUGIN_NAME (PLUGIN_NAME is the name in the first column) switches it off so you can log in. Turn it back on straight afterward and set up new 2FA backup codes.
PREFIX_user_roles option and PREFIX_capabilities user meta match $table_prefix in wp-config.php.Did this fix it?
Still stuck? Start again from what you can see in the Emergency Room.
The full fix
You enter the right password and land back on wp-login.php, or see “Cookies are blocked”. Trace the auth cookies, then fix URL, HTTPS proxy, cache and session problems.
Seeing “Sorry, you are not allowed to access this page”, lost your admin role, your password, your 2FA device or tripped a security lockout? Get back in from the server, safely.
Someone logged in as one of your users. Lock the account, kill its sessions and application passwords, secure the email behind it, then review what it changed.
Your site and email vanished and the domain now points somewhere else, or sits at a registrar you never used. Confirm what changed with RDAP, lock down the email behind the registrar login, then escalate through the registrar, the transfer dispute process and ICANN.
Your designer went quiet, closed their business or will not hand over the domain or hosting. Find out what you already control, prove you are the registrant, recover accounts in your own name, and rebuild access for anything you cannot get back.
You have just been handed a WordPress site you did not build. Work through it in a safe order: inventory and access first, an off-server backup before any change, then users, code integrity, licenses, updates and monitoring.
Someone is in your mailbox: contacts get spam from you, replies vanish or your provider blocked sending. Lock the attacker out, remove their rules and forwarding, then get delisted.
The site loads on mobile data but not on your Wi-Fi, or fails only in your office. Prove it is up, then check for a firewall block on your IP, stale DNS, IPv6 and local filters.
A visitor, a service or you got a Cloudflare block page. Search the Ray ID in Security Events, see which rule fired, and narrow it or skip it instead of turning protection off.
Your phone or Outlook keeps asking for the email password, or mail sits in the Outbox. Find out whether it is the password, the sign-in method, the server name or the port, and fix it.
Microsoft 365 from GoDaddy signs you in through GoDaddy and locks down the admin center. Learn how to confirm federation, weigh your options and move away in an order that keeps mail flowing.
Search the field manual
Or jump straight to a symptom
Press / to search from any page, Esc to close