Skip to content

WordPress Login Loop: wp-admin Keeps Redirecting to the Login Page

On this page

Last updated: · By

Short answer: you can’t log in to WordPress even though the password is right, and wp-admin keeps sending you back to the login screen? That is a login loop: the login cookie is not being saved or not being read. The four usual causes are stale browser cookies, an inconsistent site URL (www or https), a login page that got cached, and a Cloudflare security challenge or a security plugin. Here is how to check each one, in order.

⏱ Fix time: 5–30 minutes · Difficulty: easy to medium · Last checked: 7 Nov 2026

SymptomLikely causeFirst check
Works in a private window, not in a normal oneBrowser cookies or cacheDelete the site’s cookies
Works only with www or only without www, or only on http or httpsInconsistent site URLwp option get home
Fails for everyone, after a change in CloudflareLogin page cached, or a challenge on the formcf-cache-status on wp-login.php
Started after a plugin updateSecurity plugin, 2FA or a custom login URLTemporarily disable plugins
“Too many redirects” in the browserA redirect loop, not a login loopThe Too Many Redirects guide

Forgot your password? That is a different problem: resetting your WordPress password on Cloudways. Seeing ERR_TOO_MANY_REDIRECTS in the browser? Jump to the Mixed Content and redirect loops guide.

Why does wp-admin send me back to the login screen?

After a successful login, WordPress sends the browser a login cookie (wordpress_logged_in). On every visit to wp-admin it checks that cookie. If the cookie did not arrive, was not saved, or belongs to a different address, WordPress assumes you are not logged in and redirects you to wp-login.php. There is no error message, just a login screen that keeps coming back.

What should I check in the browser first?

This is the cheapest check, and the WordPress documentation starts with it: clear your browser cookies and cache.

  1. Try logging in from a private (incognito) window. If that works, the problem is in your browser, not on the site.
  2. Delete the cookies for that domain only (in Chrome: the lock icon next to the address > Cookies and site data).
  3. Temporarily disable browser extensions that block cookies or scripts, and try again.

If it happens to everyone who tries, in every browser, the problem is on the server side. Keep going.

How does an inconsistent site URL cause a login loop?

WordPress stores two addresses: home (the site address) and siteurl (the WordPress address). If one has www and the other doesn’t, or one is http and the other https, the cookie is saved for one address while the check happens on the other. This happens a lot after migrating a site or adding SSL.

  1. Connect over SSH and run wp option get home and wp option get siteurl. Both addresses should be identical, use https, and use the same www version as the primary domain of the application.
  2. If they differ, update them with wp option update home 'https://example.com' and do the same for siteurl. Take a backup first.
  3. Check wp-config.php for WP_HOME, WP_SITEURL or COOKIE_DOMAIN. According to the wp-config documentation, these constants override the settings in the database, and a wrong COOKIE_DOMAIN sends the cookie to the wrong domain.

For how to connect over SSH and run WP-CLI, see WP-CLI on Cloudways.

Can caching break the WordPress login?

Yes, and it mostly happens after someone adds an HTML cache rule in Cloudflare. According to the Cloudflare documentation, when a login page is cached, Cloudflare may strip the Set-Cookie header from it. The form loads, but the browser never receives the cookie, and after you submit it you land back on the login screen.

  1. Open wp-login.php and, in the developer tools (F12 > Network), check the cf-cache-status header. HIT on the login page is the problem.
  2. Add a rule that bypasses the cache for ‎/wp-login.php and ‎/wp-admin, and for any request with a cookie that starts with wordpress_logged_in.
  3. Purge every cache layer: Cloudflare, Varnish and Breeze. For how to do that on Cloudways, see clearing the server cache.

Varnish on Cloudways should not be the culprit: according to the Cloudways Varnish guide, wp-login.php, ‎/wp-admin and the wordpress_logged_in cookie are excluded by default. On a WooCommerce store, the same loop on the “My account” page is explained in the WooCommerce cache problems guide.

What if a security challenge or plugin blocks the login?

Protection layers on the login page are a good thing, but they can break the form. Cloudflare describes two cases: a challenge when the login page loads, which makes the site lose the session, and a challenge on the form’s POST request, which the browser has to resend.

What I saw on my own site (7 Nov 2026): on this site wp-login.php is protected by a Cloudflare challenge. A curl request got a 403 with the header cf-mitigated: challenge, while a normal browser passes the challenge and reaches the form. That is exactly the setup that can create a loop if the rule also catches the form submission.

  • Cloudflare: check which WAF or Rate Limiting rules apply to wp-login.php. Narrow them to suspicious traffic, or exclude the POST request.
  • Cloudflare Enterprise through Cloudways: according to the Cloudways Cloudflare guide, it can block access to the admin area when the login URL is customized. The fix there is to go back to the default ‎/wp-admin address.
  • Security plugins and 2FA: disable all plugins temporarily with wp plugin deactivate --all, log in, and re-enable them one by one. According to the WP-CLI documentation, you can also exclude a specific plugin with ‎–exclude.

Once you are back in, it is worth hardening the login to the Cloudways platform itself: Cloudways account security.

Black Friday80% off
80% off 2 months of managed hosting

The code BFCM802 takes 80% off your bill for the first two months (up to $200 off per month), including unlimited free site migrations. New customers only, and only until the offer ends.

The offer ends on December 4, 2026 at 23:59 (UTC+2).

Ends in—days—hours—minutes—seconds
Code:
Grab the 80% now

Start with a free trial, no credit card. Enter the code at checkout and check that it shows up.

After Black Friday: 30% off for 3 months with the code ASAEL. On a large server (above about $444 a month) ASAEL already saves more today. BFCM802 vs. ASAEL calculator

Common mistakes and how to solve them

Resetting the password to fix a loop: the password is not the problem, so a reset won’t help. If the message says “wrong password”, it is not a loop.

Editing the addresses in WordPress settings when you have no access: changing the address in Settings > General to a wrong one locks you out. Fix it through WP-CLI or the database, don’t guess.

A cache plugin that serves pages to logged-in visitors: if you turned on caching for logged-in users, you may see a page that was cached when you were logged out. Turn the option off for the Administrator role.

Frequently asked questions

Why can’t I log in to WordPress when my password is correct?

Because the login cookie is not being saved or not being read. The usual causes: stale browser cookies, a site URL that is inconsistent between www and https, a login page that got cached, or a security challenge that catches the form submission.

How do I know whether the problem is the browser or the site?

Try a private window or a different browser. If it works there, the problem is your browser’s cookies or extensions. If it fails for everyone, the problem is the server, the cache or Cloudflare.

What is the difference between a login loop and Too Many Redirects?

In a login loop you silently land back on the login screen. With Too Many Redirects the browser stops and shows an error, usually because HTTPS redirects conflict between the server and Cloudflare. Each has a different fix.

Can Cloudflare block my access to wp-admin?

Yes. A cache rule that catches wp-login.php can strip the login cookie, and a security challenge on the form submission can break it. Check cf-cache-status and the WAF rules on the login path.

How do I disable a plugin if I can’t get into the admin?

With WP-CLI: wp plugin deactivate followed by the plugin name, or ‎–all for every plugin. Without SSH, you can rename the plugin’s folder in wp-content/plugins over SFTP, and WordPress will deactivate it.

Can a custom login URL cause this problem?

Yes, mainly with Cloudflare Enterprise through Cloudways, which according to their documentation can block a customized admin address. The recommendation there is to go back to ‎/wp-admin.

Sources

Official sources: WordPress Documentation and Cloudflare Docs. Written and tested by Asael Dreyer · Updated: 7 Nov 2026

Disclosure: this is an independent site, not the official Cloudways site. Some links on this site are affiliate links: if you sign up through them we earn a commission, at no extra cost to you. Full details

Picture of Asael Dreyer
Asael Dreyer

Hi, I'm Asael Dreyer, CEO of an SEO agency that runs hundreds of websites hosted on dozens of Cloudways servers.
Everything you will find here comes from hands-on experience, mine and my teams', straight from the field: from the guides to the recommendations. All to help you get the most out of Cloudways.

More about me →

Need help? Got a question about your server or this guide? Write to us and we will get back to you.

More guides on this topic:
מפריד
Thanks for your message!
We will get back to you soon.
Ready to get started?

Sign up with the coupon code ASAEL