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

**Code:** `ERR_TOO_MANY_REDIRECTS (WordPress)` · **Category:** WordPress · **Seen on:** WordPress

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.

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/wordpress/too-many-redirects-wordpress)
