A redirect loop or too many redirects error can occur if multiple redirects from different plugins overlap, preventing visitors from accessing any particular URL or website.
The Error
When accessing the website, you might see the following errors:
On Chrome:
yourdomain.com redirected you too many times.
Try deleting your cookies.
ERR_TOO_MANY_REDIRECTS
On Firefox:
The page isn’t redirecting properly.
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
On Safari:
Safari Can't Open the Page.
Too many redirects occurred trying to open "https://yourdomain.com".
Delete Cookies
The first step is to clear the browser cache and cookies. The instructions here apply to Chrome. Similar steps are involved for other browsers:
- Launch Chrome and go to Menu (the three dots at the right-top) > Delete browsing data.
- Select Time range: All time.
- Select [*] Cookies and other site data.
- Click "Delete Data".
- Done!
- Try accessing your URL. Proceed to the next step if the issue persists.
Identify Redirect Source
WordPress plugins can trigger redirects using the native wp_redirect() function. The function sends an HTTP Header named X-Redirect-By. Inspect HTTP Headers to identify what is causing the redirect:
- Go to
https://www.redirect-checker.org
.
You can also check using your browser's developer tools orhttps://httpstatus.io
. - Enter your website URL and click "analyse".
- Now, check if the "HTTP Headers" contain "X-Redirect-By". For example:
X-Redirect-By:
WordPress
Note
If the value is a plugin name, the redirect originated from that plugin.
If the value is "WordPress", install WP Core Monitor as mentioned below. - The presence of "X-Redirect-By" indicates that the redirect was performed by WordPress.
- Done!
Using WP Core Monitor:
If the value of "X-Redirect-By" is "WordPress" and WordPress' built-in functions are the cause of the redirect, install the following plugin to track down its source:
WP Core Monitor: https://wcom.pro
You can use it to monitor and analyze the backtrace data to pinpoint conflicting plugins and the specific functions responsible for the redirect.
Disable Offending Plugins
- If the value of "X-Redirect-By" is a plugin name:
Disable the plugin or reconfigure the redirects within the plugin to resolve the issue.
RankMath, Redirection, Yoast SEO, Permalink Manager, AIO SEO, etc., are some of the known plugins that create redirects. - If the value of "X-Redirect-By" is "WordPress":
Install WP Core Monitor as mentioned above to identify the root cause of the redirect. Disable the offending plugin or make necessary code adjustments to resolve the issue. - Try accessing your URL. The issue should have been fixed by now. Proceed to the next step if not.
Alternative Method
A common way to identify the offender is by disabling plugins one by one until the redirect stops. The last plugin is the source of the redirect. Keep it disabled or modify its settings.