ERR_TOO_MANY_REDIRECTS on WordPress: how to fix it

The browser gave up because the site kept sending it in a circle. On WordPress the loop is almost always between http and https, or between www and the bare domain. Two settings disagree and each one sends the visitor to the other.

What to do, in order

  1. Clear cookies for the site first. A stale login cookie can cause the loop by itself. Try a private window. If the site loads there, you are done.
  2. Check the two addresses. In wp-config.php, add define('WP_HOME','https://example.com'); and define('WP_SITEURL','https://example.com'); with your real address. Pick one form, with or without www, and use it in both.
  3. Behind Cloudflare? If SSL mode is "Flexible", Cloudflare talks plain http to your server, WordPress redirects to https, and the loop starts. Set SSL/TLS to "Full" or "Full (strict)".
  4. Behind any proxy or load balancer? WordPress may not know the visitor came in on https. Add this to wp-config.php above "That's all": if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO']==='https') $_SERVER['HTTPS']='on';
  5. Look for doubled redirect rules. An https rule in .htaccess plus a plugin like Really Simple SSL plus a host setting is three rules doing one job. Keep one.
  6. Turn off plugins. Rename wp-content/plugins over FTP. If the loop stops, rename it back and turn plugins off one at a time. Redirect, SSL and cache plugins are the usual suspects.

Check it yourself

Run curl -sIL https://example.com | grep -i -E "^(HTTP|location)". You will see each hop. If the same two addresses repeat, those are the two settings that disagree.


Want the rest of your site checked after it is back? Run a free 40-point check at tinkeraudit.com.