Last updated: · By Asael Dreyer
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
| Symptom | Likely cause | First check |
|---|---|---|
| Works in a private window, not in a normal one | Browser cookies or cache | Delete the site’s cookies |
| Works only with www or only without www, or only on http or https | Inconsistent site URL | wp option get home |
| Fails for everyone, after a change in Cloudflare | Login page cached, or a challenge on the form | cf-cache-status on wp-login.php |
| Started after a plugin update | Security plugin, 2FA or a custom login URL | Temporarily disable plugins |
| “Too many redirects” in the browser | A redirect loop, not a login loop | The 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.
- Try logging in from a private (incognito) window. If that works, the problem is in your browser, not on the site.
- Delete the cookies for that domain only (in Chrome: the lock icon next to the address > Cookies and site data).
- 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.
- Connect over SSH and run
wp option get homeandwp option get siteurl. Both addresses should be identical, use https, and use the same www version as the primary domain of the application. - If they differ, update them with
wp option update home 'https://example.com'and do the same for siteurl. Take a backup first. - 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.
- 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.
- 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.
- 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.
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).
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
Start a free trial server, no credit card. When you move to a paid plan, the code ASAEL takes 30% off your bill for the first three months.
The link fills in the code on the signup form. Just make sure it shows up.
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
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.
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.
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.
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.
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.
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.
Related guides
- Forgot my password: resetting a WordPress password on Cloudways
- Mixed Content and Too Many Redirects
- Clearing the server cache on Cloudways
- Cloudways account security
- Cloudways review: who it is for
- All guides on this topic: Security guides
Sources
- Troubleshoot login issues – WordPress Documentation
- Editing wp-config.php – WP_HOME, WP_SITEURL, COOKIE_DOMAIN
- wp plugin deactivate – WP-CLI
- Dynamic content and login issues – Cloudflare Docs
- How to Use Varnish at Cloudways – Cloudways KB
- How to Enable Cloudflare on Your Application – Cloudways KB
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