Skip to content

WordPress "Too many redirects" loop: diagnosing the redirect cycle

A WordPress redirect loop has six common shapes. Here is how to identify which one you have, where the bad rule lives, and how to break the WordPress loop without breaking SSL.

“Too many redirects” or ERR_TOO_MANY_REDIRECTS from a WordPress site means two layers disagree about where the canonical URL lives, and each tries to fix the other. The browser bounces between them until it gives up. The pattern is almost always one of six setups — and the fix is always at one specific layer, not “everywhere”.

What’s happening

WordPress reads siteurl and home from the database (or from wp-config.php constants if set) and uses them to rewrite URLs and issue canonical redirects. The web server has its own redirect rules in .htaccess or Nginx config. A CDN like Cloudflare has its own “Always Use HTTPS” or page rules. A plugin like Really Simple SSL adds its own. When two of these disagree — say, WordPress thinks the canonical is https://www.example.com but Cloudflare’s page rule rewrites it to https://example.com, which WordPress then redirects back to www — the browser is stuck.

The common shapes: WWW vs non-WWW disagreement, HTTPS vs HTTP disagreement, trailing-slash disagreement, “force HTTPS” plugin fighting Cloudflare flexible SSL, wp-config.php WP_HOME constant out of sync with siteurl in the database, and Cloudflare’s SSL mode set to “Flexible” while WordPress forces HTTPS.

How to verify

curl -IL https://example.com/ 2>&1 | grep -i location
curl -IL http://example.com/ 2>&1 | grep -i location
wp option get siteurl
wp option get home
wp config get WP_HOME
wp config get WP_SITEURL

curl -IL follows redirects and prints each Location header. The output will show the loop — https://example.com/ redirects to https://www.example.com/ redirects to https://example.com/. That tells you the two endpoints that disagree.

The fix

  1. Pick one canonical hostname. Decide WWW or non-WWW, then make every layer agree. siteurl and home in WordPress, Cloudflare page rules, web server redirects, plugin settings.
  2. Match Cloudflare SSL mode to origin. If WordPress forces HTTPS and Cloudflare is set to “Flexible” (Cloudflare-to-origin is HTTP), the origin sees HTTP, WordPress redirects to HTTPS, Cloudflare strips it again. Set Cloudflare SSL to “Full (strict)” with a real origin cert.
  3. Check the WP_HOME constant. If wp-config.php defines WP_HOME differently from the database home option, WordPress will fight itself. Sync them.
  4. Disable redirect plugins for the diagnosis. Really Simple SSL, WP Force SSL, Redirection — temporarily disable each. If the loop clears, you’ve found the plugin overlay.
  5. Empty the .htaccess redirect block. Comment out everything outside the WordPress block. If the loop clears, the redirect was in .htaccess — usually a leftover from a previous host.
  6. Check the network panel in DevTools. Chrome’s network tab will show each redirect and the response headers. Read the Set-Cookie headers — sometimes a redirect loop is caused by a cookie that fails to set on the first redirect.

For sites where redirects need to stay consistent across migrations and CDN changes, Stack Harbor automates the diagnostic in enterprise WordPress support operations. For a current loop, book a consult.