Skip to main content

How to Troubleshoot a WordPress Redirect Loop

A redirect loop occurs when a WordPress site repeatedly redirects a user between different URLs, preventing the page from loading. This issue typically affects the Site Administrator and is often caused by incorrect URL configurations, plugin...

A redirect loop occurs when a WordPress site repeatedly redirects a user between different URLs, preventing the page from loading. This issue typically affects the Site Administrator and is often caused by incorrect URL configurations, plugin conflicts, or server-side caching.

Before you begin

You will need:

  • Administrator access to your WordPress dashboard (if accessible) or access to your site's files and database via a tool like phpMyAdmin or an FTP client.

  • Access to your hosting control panel to check server-side configurations.

Check your WordPress Address settings

Incorrectly configured site URLs are a common cause of redirect loops.

  1. Access your site's wp-config.php file via your hosting control panel's File Manager or an FTP client.

  2. Locate the lines that define WP_SITEURL and WP_HOME.

  3. Ensure both values match your desired URL exactly.

  4. If you need to force these values to override database settings, update the file to include the following:

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

    Replace https://example.com with your actual domain.

Check your .htaccess file

A malformed .htaccess file can cause the server to loop requests.

  1. Access your site's root directory via your hosting control panel's File Manager or an FTP client.

  2. Locate the .htaccess file.

  3. Rename the file to .htaccess_old to disable it temporarily.

  4. Attempt to load your website.

  5. If the site loads, the issue is within the .htaccess file. You can then create a new .htaccess file with the standard WordPress configuration:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [C,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

  6. Save the file and test your site.

Identify plugin conflicts

A plugin that handles redirects or SEO may be misconfigured or conflicting with another plugin.

  1. Access your site's root directory via your hosting control panel's File Manager or an FTP client.

  2. Navigate to the wp-content folder.

  3. Rename the plugins folder to plugins_old. This will deactivate all active plugins.

  4. Attempt to load your website.

  5. If the site loads, a plugin is causing the loop.

  6. Rename the folder back to plugins.

  7. Rename each individual plugin's folder inside wp-content/plugins/ one by one (e.g., plugin-name_old) and refresh your site until you identify the specific plugin causing the issue.

  8. Once identified, do not reactivate that plugin until you can investigate its settings or find an alternative.

Clear your cache

Cached versions of your site or server-side cache can sometimes "trap" a redirect loop.

  1. If you use a WordPress caching plugin, clear the cache via the plugin's settings (if you can access the dashboard).

  2. If you use a server-side cache (such as LiteSpeed or Varnish), purge the cache through your hosting control panel.

  3. Clear your browser's cache and cookies to ensure you are not viewing a cached redirect.

Confirm the result

  • The website loads successfully at your primary domain.

  • Navigation between internal pages does not result in a "Too many redirects" error.

Limitations

  • This procedure does not resolve issues caused by external DNS configurations or third-party CDN settings (such as Cloudflare) unless the specific configuration within those services is corrected.

  • If the redirect loop persists after these steps, the issue may be related to a specific server-side configuration that requires a review of your hosting environment.

Did this answer your question?