Aj Khandal

Resolving ERR_TOO_MANY_REDIRECTS in WordPress: A Step-by-Step Server & Database Guide

Understanding the ERR_TOO_MANY_REDIRECTS Loop

Before diving into fixes, let’s understand the mechanics. A redirect loop happens when:

  1. Your browser requests URL A.
  2. The server (or WordPress) tells the browser to go to URL B.
  3. URL B then tells the browser to go back to URL A (or URL C, which then redirects to URL A or B).

This cycle repeats endlessly until the browser gives up, displaying the “too many redirects” error.

Common Culprits:

  • Incorrect WordPress Address (URL) Settings: Mismatched WordPress Address (URL) and Site Address (URL) in your database.
  • .htaccess File Misconfiguration: Improper redirect rules causing a loop.
  • SSL/HTTPS Issues: Incorrectly forcing HTTPS, leading to an HTTP > HTTPS > HTTP loop.
  • Plugin Conflicts: Security, caching, or redirection plugins clashing.
  • Server Configuration: Less common, but sometimes server-level redirects can be involved.

Step 1: Clear Your Browser Cache & Cookies (The Easiest Fix First)

Before you panic and start editing files, perform the simplest troubleshooting step:

  1. Clear your browser’s cache and cookies.
  2. Try accessing your site in an Incognito/Private window or a completely different browser.

Sometimes, your browser’s stored data is simply outdated or corrupted, causing it to remember old redirect rules. If this works, great! If not, proceed to more technical solutions.


Step 2: Check Your wp-config.php for Forced URLs (Direct File Edit)

It’s common for developers or even plugins to hardcode WordPress URLs in wp-config.php. If these are incorrect or conflict with other settings, they can cause a loop.

  1. Connect to your server via FTP/SFTP (or use your hosting provider’s File Manager).
  2. Navigate to your WordPress root directory (where wp-config.php is located).
  3. Open wp-config.php for editing.
  4. Look for lines similar to these:
    define('WP_HOME', 'http://yourdomain.com');
    define('WP_SITEURL', 'http://yourdomain.com');
    
  5. Temporarily comment out or remove these lines.
    • To comment out: Add // at the beginning of each line (e.g., // define('WP_HOME', 'http://yourdomain.com');).
  6. Save the file and try to access your site.

If your site loads: You’ve found the issue! Make sure the URLs were correct. If you still want to hardcode them, ensure they use https:// if your site is SSL-enabled, and match your intended domain exactly.


Step 3: Inspect and Correct WordPress URLs in Your Database (Critical Step)

This is the most frequent cause of redirect loops. WordPress stores its primary URL settings in the wp_options table of its database. Mismatched or incorrect entries here are deadly.

You’ll need access to phpMyAdmin or a similar database management tool (usually available via your hosting control panel).

  1. Log into your hosting account’s cPanel (or equivalent).
  2. Find and open phpMyAdmin.
  3. Select your WordPress database from the left sidebar.
  4. Browse the wp_options table (note: your table prefix might be different, e.g., wp_xyz_options).
  5. Look for the option_name fields:
    • siteurl
    • home
  6. Crucially, check their option_value fields. Ensure they are identical and correct, including https:// if your site uses SSL, and the correct www or non-www prefix.
    • Example of correct configuration for HTTPS:
      • siteurl: https://yourdomain.com
      • home: https://yourdomain.com
  7. If you find any discrepancies or incorrect URLs, double-click the option_value to edit it, correct the URL, and press Enter to save.
  8. Clear your browser cache again and try accessing your site.

Alternative Database Fix (When phpMyAdmin is Too Much):

If you’re uncomfortable with phpMyAdmin, you can temporarily add these lines back to your wp-config.php below the ABSPATH definition to force WordPress to use specific URLs on load. This overrides database values:

define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');

Remember to use your actual domain and https:// if applicable! Once you regain access, check Settings > General in your WordPress dashboard. If the URLs appear correct there, you can remove these two lines from wp-config.php as the database values are now correct.


Step 4: Reset Your .htaccess File (Server-Side Redirects)

The .htaccess file, located in your WordPress root directory, handles server-level redirects and URL rewrites. A misconfigured .htaccess is a prime suspect for redirect loops.

  1. Connect via FTP/SFTP (or use your hosting File Manager).
  2. Navigate to your WordPress root directory.
  3. Locate the .htaccess file.
  4. Rename it to something like htaccess_old.txt or htaccess_backup.bak. This effectively deactivates it without deleting it.
  5. Create a new file named .htaccess in the same directory.
  6. Paste the default WordPress .htaccess rules into this new file:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
  7. Save the new .htaccess file.
  8. Clear your browser cache and try to access your site.

If your site loads: The old .htaccess file was the culprit. You’ll now need to go to Settings > Permalinks in your WordPress dashboard and simply click “Save Changes” (without making any actual changes). This will regenerate the default .htaccess rules and ensure your permalinks work. If you had custom redirects or rules, you’ll need to carefully re-add them one by one to your new .htaccess file, testing after each addition to find the problematic rule.


Step 5: Deactivate All Plugins (Plugin Conflict Resolution)

Plugins, especially those related to security, caching, or redirects (e.g., Yoast SEO, Rank Math, Redirection, Really Simple SSL, caching plugins), can often cause redirect loops due to conflicting rules or misconfigurations.

Since you likely can’t access wp-admin, you’ll need to deactivate them manually via FTP.

  1. Connect via FTP/SFTP.
  2. Navigate to /wp-content/.
  3. Rename the plugins folder to plugins_old.
  4. Clear your browser cache and try to access your site.

If your site loads: A plugin was causing the conflict.

To find the specific plugin:

  1. Rename plugins_old back to plugins.
  2. Log into your WordPress dashboard (it should now be accessible, though plugins will still be inactive).
  3. Go to Plugins > Installed Plugins.
  4. Activate your plugins one by one, testing your site after each activation. The moment the ERR_TOO_MANY_REDIRECTS error reappears, you’ve found the conflicting plugin.
  5. Once identified, you can either:
    • Delete it and find an alternative.
    • Contact the plugin developer for support.
    • Look for specific settings within that plugin that might be causing a redirect.

Step 6: Check Server Configuration (Advanced / Hosting Support)

While less common, sometimes server-level redirects or misconfigurations in your virtual host settings can cause loops.

  • Cloudflare/CDN: If you’re using a CDN like Cloudflare, ensure your SSL settings are configured correctly. A common issue is having Cloudflare set to “Flexible SSL” while WordPress is trying to force full SSL, leading to a loop between Cloudflare and your origin server. Try setting Cloudflare’s SSL to “Full (strict)” or “Full.”
  • Nginx Configuration: If your server uses Nginx instead of Apache, there’s no .htaccess file. You’ll need to check your Nginx configuration files (e.g., nginx.conf or site-specific config files) for redirect directives that might be causing the loop. This usually requires server access or contacting your hosting provider.

If you’ve exhausted all other options, it’s time to contact your hosting support team. Provide them with details of the error and the steps you’ve already taken. They can often review server logs and configurations that you might not have access to.


Conclusion: A Systematic Approach Saves Your Site

The ERR_TOO_MANY_REDIRECTS error can be a major headache, but by systematically working through your wp-config.php, database, .htaccess file, and plugins, you can pinpoint and resolve the issue. Remember to always clear your browser cache between steps and, most importantly, always have a recent backup before making any direct file or database edits.

Don’t let a redirect loop hold your WordPress site hostage. By following these developer-level troubleshooting steps, you’ll regain control and get your site back online.

Still seeing too many redirects and feeling lost in the code?

If you’ve tried these solutions and your WordPress site is still stuck in a redirect loop, it might be time for expert intervention. Contact me for professional WordPress emergency support and debugging services. I can help diagnose and fix complex server and database issues quickly.

Need Help?