How to Fix the 'Too Many Redirects' Error in WordPress

A complete technical guide to fixing the ERR_TOO_MANY_REDIRECTS issue in WordPress by correcting site URLs, clearing cookies, and fixing SSL/Cloudflare settings.

How to Fix the 'Too Many Redirects' Error in WordPress

The ERR_TOO_MANY_REDIRECTS error is a classic routing nightmare. Unlike an error caused by a broken script or an overloaded server, this error indicates a logical flaw in how your website’s traffic is being directed.

Essentially, your website is trapped in an infinite loop.

Imagine you ask a security guard where Room 101 is, and he tells you to ask the receptionist. When you ask the receptionist, she tells you to ask the security guard. You would walk back and forth endlessly. Browsers are smart enough to recognize this loop and will automatically break the connection, displaying the Too Many Redirects error to prevent your computer from crashing.

In this guide, we’ll break down the most common causes of this redirect loop in WordPress and how to fix them.


What Causes the Redirect Loop?

Redirect loops in WordPress are almost always caused by a misconfiguration in one of three areas:

  1. Mismatched WordPress URL Settings: The URL stored in the WordPress database differs from the actual URL of the site (e.g., forcing HTTPS when the site is configured for HTTP).
  2. Third-Party CDN/SSL Conflicts: A misconfigured SSL setting in Cloudflare or another Content Delivery Network (CDN) is conflicting with your origin server’s SSL certificate.
  3. Corrupted Cache or .htaccess Rules: A caching plugin or a botched 301 redirect rule in your .htaccess file is sending traffic in circles.

Step 1: Clear Your Browser Cookies & Cache

Before you start tearing apart your server configurations, make sure the loop isn’t happening locally on your computer. Sometimes, an expired or corrupted session cookie will trap your browser in an authentication loop with the wp-login.php page.

Clear your browser’s cookies and cache entirely, or try loading your website in an Incognito/Private window. If the site loads fine in Incognito mode, the problem was purely on your end!


Step 2: Fix the WordPress URL Settings via wp-config.php

The most common cause of a redirect loop is a mismatch between your WordPress Address and Site Address. This frequently happens immediately after installing an SSL certificate if the database wasn’t updated properly.

Since the redirect error usually blocks you from logging into the wp-admin dashboard, you must hardcode the correct URLs directly into your configuration file.

  1. Connect to your site via FTP or your hosting File Manager.
  2. Open the wp-config.php file located in the root directory.
  3. Add the following two lines of code right above the /* That's all, stop editing! */ line. Make sure to replace yourdomain.com with your actual domain, and ensure you use https:// if you have an SSL certificate installed.
define( 'WP_HOME', 'https://yourdomain.com' );
define( 'WP_SITEURL', 'https://yourdomain.com' );

Save the file and reload your site. Hardcoding the URLs here will override whatever incorrect values are stuck in the database.


Step 3: Fix Cloudflare SSL Settings (The “Flexible” Trap)

If you use Cloudflare to protect your site, this is the most likely culprit.

If you have a free SSL certificate (like Let’s Encrypt) installed on your origin hosting server, but your Cloudflare SSL/TLS encryption mode is set to Flexible, you will instantly trigger a massive redirect loop.

Why? Because in “Flexible” mode, Cloudflare connects to your server over unencrypted HTTP. However, your origin server sees the HTTP request and forces a redirect to HTTPS. Cloudflare intercepts that HTTPS redirect, downgrades it back to HTTP, and sends it back to the server. The loop is born.

The Fix:

  1. Log into your Cloudflare dashboard.
  2. Select your domain.
  3. Click on the SSL/TLS tab in the sidebar.
  4. Change the encryption mode from Flexible to Full or Full (strict).

Wait about 30 seconds for Cloudflare to purge its cache, and your site should instantly come back online.


Step 4: Deactivate Plugins and Reset .htaccess

If the steps above didn’t work, a rogue SEO or redirect plugin (like Redirection or Yoast) might have written a bad rule.

  1. Go to your File Manager and rename the wp-content/plugins folder to plugins_deactivated to disable all plugins.
  2. Next, find the .htaccess file in your root folder and rename it to .htaccess_old.
  3. Refresh the site. If it loads, you can safely log into your dashboard, reactivate your plugins one by one, and go to Settings > Permalinks and click “Save Changes” to generate a fresh, error-free .htaccess file.

[!TIP] Dealing with SSL certificates, .htaccess files, and CDNs can be overly technical. If you host your site on our Nextgen WordPress Hosting, our technical support team handles all SSL and Cloudflare configurations automatically, ensuring you never fall into a redirect loop in the first place!

When redirect loops arise from misconfigured server limits, upgrade to high-performance shared hosting.