ERR_TOO_MANY_REDIRECTS in WordPress: Causes and Fixes
Seeing “redirected you too many times” on your WordPress site? Learn what a redirect loop is and how to fix URL, HTTPS, Cloudflare and plugin causes.
If your browser says “This page isn't working” and “redirected you too many times”, with the code ERR_TOO_MANY_REDIRECTS, your WordPress site is stuck in a redirect loop. There are only a few usual causes: the two site addresses in WordPress do not match, HTTPS is forced in two places, Cloudflare talks to your server over plain HTTP, or plugins send visitors back and forth. Here is how to find and fix yours.
What a redirect loop is
A redirect is an instruction that says “this page has moved, go here instead”. That is normal: most sites send visitors from http:// to https://, or from example.com to www.example.com.
A loop happens when two rules disagree. One rule sends the browser from address A to address B, and another sends it straight back to A. After about 20 rounds the browser gives up and shows the error.
First, rule out your browser
Sometimes the loop sits in an old cookie, a small file the site saved in your browser. This often happens after a site moves to HTTPS. Try two checks before you change anything:
- Open the site in a private window. A private window (Incognito in Chrome) starts without your saved cookies. If the site loads there, the problem is only in your normal browser.
- Clear the cookies for that one site. In your browser's privacy settings, find the domain and delete its data. You do not need to clear your whole history.
If the private window shows the same error, the loop is on the site itself. Work through the causes below one at a time, and test in a private window after each change.
Cause 1: the WordPress Address and Site Address do not match
WordPress stores two addresses. The WordPress Address is where the WordPress files live. The Site Address is the address visitors type. On most sites they should be exactly the same.
A loop starts when they differ slightly, or disagree with your server. Common mismatches:
- http:// in one field and https:// in the other;
- www.example.com in one and example.com in the other;
- the server adds www, while WordPress removes it.
Fix it in Settings
If you can still log in, open Settings → General. Make both fields identical: start with https://, pick the version your site uses, with or without www, and leave off the slash at the end. Save, then test.
Fix it in wp-config.php
If the loop locks you out of the dashboard, set the addresses in wp-config.php, the main settings file in your WordPress folder. Open it in your control panel's file manager, keep a copy, and add these two lines above the comment that says “That's all, stop editing!”:
define( 'WP_HOME', 'https://www.example.com' );
define( 'WP_SITEURL', 'https://www.example.com' );Put your own address in place of www.example.com. WP_HOME is the Site Address and WP_SITEURL is the WordPress Address. While these lines stay in the file, the two fields in Settings are greyed out. That is expected.
Cause 2: HTTPS is forced twice
HTTPS is the secure version of a web address. You need only one rule that sends visitors from http:// to https://. Trouble starts when several tools do it in different ways, for example one adds www and another removes it.
An HTTPS rule can hide in several places:
- an SSL or security plugin with a “force HTTPS” option;
- the .htaccess file, a small rules file in your site's main folder that the Apache web server reads;
- a hosting panel setting, such as “Permanent SEO-safe 301 redirect from HTTP to HTTPS” in Plesk;
- a redirect rule at Cloudflare or another service in front of your site.
Keep the rule in one place and remove it from the others. Start with the plugin, because it is the easiest change to undo. Save a copy of .htaccess before you edit it.
Cause 3: Cloudflare's SSL mode is set to Flexible
If your site uses Cloudflare, it sits between your visitors and your server, keeps copies of your pages close to visitors and filters attacks. Its SSL/TLS encryption mode decides how it connects to your server.
In Flexible mode, the visitor's connection to Cloudflare is secure, but Cloudflare talks to your server over plain HTTP. Your server or WordPress answers “use HTTPS”. Cloudflare asks again over HTTP, gets the same answer, and the loop begins.
The usual fix is Full (strict). Cloudflare then connects over HTTPS and checks that your server has a valid certificate, so one must be installed. The server now sees a secure request and has no reason to redirect.
On our hosting, Cloudflare sits in front of every site. If you suspect Cloudflare, for example because the loop began right after a DNS or SSL change, please open a ticket. Tell us the domain and when the error began. Our free SSL page explains how the connection between Cloudflare and our servers is secured.
Other causes: plugins, migrations and domain changes
Redirect and caching plugins that clash
Redirect, SEO and caching plugins can all send visitors elsewhere, and a cache can keep serving an old redirect after you fix the real cause. If the error started after you installed or updated a plugin, deactivate it and clear the cache. Locked out of the dashboard? Rename that plugin's folder in wp-content/plugins with the file manager to switch it off. Not sure which plugin it is? Rename the whole plugins folder. If the site then loads, log in and open the Plugins screen; WordPress marks the missing plugins inactive. Then rename the folder back and reactivate the plugins one by one, testing after each.
After a migration or a domain change
Moving to a new host or domain is a common trigger, because the database may still hold the old address. Picture an accountant in Tirana moving from an old .com to a new .al domain: if WordPress still points to the old domain, which redirects to the new one, the browser bounces between them.
Fix the two addresses first. Then replace the old address in the database with a search-and-replace tool built for WordPress, as described in WordPress's migration guide, because a plain text replace can break stored settings. Finally, remove .htaccess rules you no longer need.
Moving to Zebra Hosting without the loop
Many redirect loops start during a move. On our WordPress hosting, we migrate your site for free and test it on a preview link before you point your domain to us, so we can catch problems like this before visitors see them. Every domain also gets free SSL that renews automatically.