A WordPress site maintainer tracing a login redirect loop through cookies, site addresses and a reverse proxy

Editorial illustration; the screens are representative, not a real WordPress interface.

You enter the correct password, see the dashboard for a moment, and land back at the login page. Or /wp-admin/ redirects between HTTP and HTTPS until the browser gives up. The loop can look like a bad password, but WordPress may be setting a cookie for a different host, path or security context than the next request uses.

This workflow is for a site owner or developer who can access the hosting control panel or ask a host for help. It starts with reversible checks, then moves toward configuration changes only when the evidence points there.

Summary

  • First test a clean browser session and record the exact URL after each redirect.
  • Confirm home and siteurl use the intended host and scheme; do not change both blindly.
  • If HTTPS ends at a proxy or CDN, verify that WordPress receives the correct original host and secure-request information.
  • Exclude login and authenticated pages from caching, then isolate plugin conflicts only with a recovery plan.

Start by identifying the loop

Write down the URL you open, the URL after submitting credentials and the final URL shown by the browser. Include whether the address changes between www and the bare domain, or between http and https. Note if the problem affects every administrator, one account, one browser or only a network behind a VPN or proxy.

This small record separates a password problem from a redirect problem. A wrong password normally produces an error at the login form. A redirect loop repeatedly changes where the browser is sent. WordPress authentication also relies on cookies, so a browser that rejects or keeps an old cookie can appear to “forget” a successful login.

A low-risk diagnostic sequence

1. Test without changing the site

Open a private browser window and visit the canonical login URL directly, such as https://example.com/wp-login.php. If that works, clear only this site’s cookies in the original browser and retry. Avoid clearing all browser data if you need saved sessions elsewhere.

If the private window fails too, try another browser or trusted network. Do not send your password to a third-party troubleshooting page. Record the full redirect chain if you can, but remove query parameters that contain temporary tokens before sharing it with support.

2. Compare WordPress’s two site addresses

WordPress stores a Site Address (siteurl) and a WordPress Address (home). They can be different when core files live in a subdirectory, so they should not be forced to match without understanding the installation. Compare both values in Settings → General if you can access the dashboard, or ask your host to inspect the options table.

Also check wp-config.php for WP_HOME and WP_SITEURL constants. If constants are present, they can override the database values. A common failure after a domain or HTTPS migration is one setting using http:// while the other uses https://, or one including www while the other does not.

If you make a correction, take a backup first and change one source of truth at a time. Do not paste example values from a forum without replacing the domain with your exact canonical address. If the site URL is wrong, changing it incorrectly can make the dashboard harder to reach.

3. Check what the browser receives

In browser developer tools, inspect the login response and see whether a wordpress_test_cookie or authentication cookie is set. You do not need to copy or publish the cookie value. Look for a warning that the cookie was blocked, or a cookie domain/path that does not fit the host you are using.

Try the canonical host consistently. For example, if the site is meant to use www.example.com, do not alternate between that and example.com while testing. Cookies can be scoped to a host or path; a successful login on one host may not be recognised on the other.

4. Follow the HTTPS path through your proxy

A reverse proxy or CDN may terminate HTTPS at the edge and connect to the origin over HTTP. If WordPress does not know that the visitor’s original request was HTTPS, it can generate redirects or cookies with the wrong security setting. WordPress’s official HTTPS guidance warns that SSL handled by a reverse proxy can create redirect loops when the origin and proxy disagree about the request scheme.

Check the host or proxy’s documented configuration. Confirm it forwards the original host and scheme using the headers your stack expects, and that the server trusts those headers only from the proxy. Do not blindly add X-Forwarded-Proto snippets to wp-config.php; a misconfigured trust rule can create an insecure assumption or fail to solve the mismatch.

5. Rule out cache interference

A login page should not be served as a shared cached page. Ask whether the page cache, CDN or host cache is excluding wp-login.php, /wp-admin/ and responses tied to authenticated cookies. Purge the relevant cache after changing a rule, then test again in a fresh private session.

A cache purge is not a cure for incorrect URLs or proxy headers. If the redirect chain is unchanged after the purge, keep investigating the setting that causes the redirect instead of repeatedly clearing every cache on the site.

6. Isolate plugin or theme conflicts

If the issue began immediately after installing or updating a plugin, that timing is useful evidence. Use the host’s file manager or recovery tools to disable one suspected plugin, then retry. If you must rename the plugins directory to test broadly, understand that this disables all plugins and may affect forms, commerce, security or caching. Do it during a quiet period, preserve a note of the original folder name and restore it as soon as the test is complete.

A staging copy is safer for a business-critical site. If there is no staging site and administrators are locked out, ask the host to make a restorable backup before changing files. Once access returns, enable plugins in small groups to find the conflict rather than leaving everything disabled.

What to send your host

A useful support ticket includes the canonical site URL, WordPress version, whether all accounts are affected, the observed redirect sequence, recent changes, and whether private browsing changed the result. Add the proxy/CDN and cache products in use, but never include passwords, session cookies, secret keys or a full database export.

If you can access server logs, note the timestamp and any repeated redirects around wp-login.php. The host can compare the request scheme and host at the proxy and origin. That is more actionable than “WordPress is broken” and helps avoid random configuration edits.

Common fixes that cause new trouble

  • Changing the database URL before checking constants. A constant may immediately override the value you just edited.
  • Disabling every plugin on the live site without warning. This can interrupt customer-facing features and obscure which extension caused the issue.
  • Forcing HTTPS in several layers at once. Pick a canonical redirect owner and verify the proxy’s scheme handling.
  • Sharing a cookie value with support. Cookies can grant account access; share the cookie name or error, never its secret value.
  • Treating a login loop as proof of compromise. It can be a configuration mismatch. Investigate calmly, while using a separate trusted admin account if you suspect unauthorised changes.

For a broader account-defense setup, see the guide to protecting the WordPress admin login. If the site was recently moved to HTTPS, the HTTPS setup guide covers the certificate and redirect side of that change.

My Take

The temptation is to change URL settings, disable plugins and purge every cache in one pass. That may make the loop disappear, but it also hides the cause and can create a second outage. A browser test and a short redirect record usually tell you which layer to inspect next.

Conclusion

Start with a private browser session and the exact redirect URLs. Check the host and scheme WordPress uses, then inspect cookies, proxy headers and cache rules in that order. Make one reversible change at a time, and get a restorable backup before file or database edits on a live site.

Sources