ERR_TOO_MANY_REDIRECTS (WordPress) 📝 WordPress

WordPress: ERR_TOO_MANY_REDIRECTS / redirected you too many times on wp-admin or the whole site

WordPress and the server/proxy keep redirecting to each other — usually siteurl/home mismatch (http vs https, www vs non-www) or HTTPS detection behind a proxy/load balancer.

Seen on: WordPress

Meaning

Behind Cloudflare Flexible SSL or a load balancer, WordPress sees plain HTTP and redirects to HTTPS forever. Mismatched WordPress Address/Site Address and server redirect rules also loop.

Common causes

  • siteurl/home differ from the actual URL (www, https)
  • HTTPS terminated at a proxy without X-Forwarded-Proto handling
  • Conflicting redirects in .htaccess/Nginx and a plugin
  • Cookie/caching plugin loops on wp-admin

⚡ Quick fix

  1. Set WP_HOME and WP_SITEURL to the exact canonical URL
  2. Tell WordPress it’s on HTTPS behind the proxy
  3. Remove duplicate redirect rules; clear caches

Detailed fix by platform

WordPress

  1. php
    // wp-config.php
    define('WP_HOME', 'https://www.example.com');
    define('WP_SITEURL', 'https://www.example.com');
    if (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https') { $_SERVER['HTTPS'] = 'on'; }

Shell

  1. php
    curl -sIL http://example.com/wp-admin/ | grep -iE '^(HTTP|location)' | head -20
    wp option get siteurl && wp option get home

How to diagnose

  1. Chain — Redirect hops
  2. Options — siteurl/home
  3. Proxy — Flexible SSL / X-Forwarded-Proto

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.