How to Fix the “Err_Too_Many_Redirects” Error in WordPress
Getting WordPress errors can be quite stressful for any user. Furthermore, if you have very little information to go on, solving them can seem quite challenging. One such error that can occur quite frequently is the Too Many Redirects error. It appears when you try to access a certain page and it takes too long to load because the page is getting redirected to other links. And even after waiting, you end up getting a blank page suggesting this error instead of the page you were looking for. If this has ever happened to you, you should know that there’s nothing to worry about. In this article, we will take a closer look at what this error is and how to tackle it using a few simple methods:
What Is the Err Too Many Redirects Error
Depending on the browser, there are multiple messages variations that can be displayed for this error. In Chrome and Microsoft Edge, users will be told that the address has redirected you too many times. While in Mozilla the message states that the page isn’t redirecting properly. Some browsers may also offer a helpful piece of advice on how to solve the issue besides showing the error message. For example, Chrome suggests that you try clearing your cookies, which is one of the first steps for troubleshooting this error. It also references the error under the term ERR_TOO_MANY_REDIRECTS that you can use to search further.
As for the error itself, it means that your website is caught in an infinite redirection loop. Essentially, when you try to access a URL, you are redirected to another, then back to the first, and so forth. That’s why redirection loop is another term used for this error. Therefore, we will use all three terms interchangeably—Too many redirects, err_too_many_redirects, and redirection loop issue in this article.
How to Solve the Err Too Many Redirects Error
Now that we’ve explained what the error is, we can proceed to solve it efficiently. There are many reasons why the Too Many Redirects error can occur. Those include various caching issues, improperly set website URLs, and faulty code. Therefore, we have carefully divided the troubleshooting steps into four separate sections, which you should carefully follow.
As redirect loops can happen due to cached data, we suggest clearing all cache as a first troubleshooting step. For ease of use, we grouped all relevant forms of cache clearing in this section. Please note that clearing any type of cache may impact your website loading. Nevertheless, this is an important step towards solving the redirect loop issue.
WordPress uses browser cookies for user authentication and managing sessions. However, a user may experience the Too Many Redirect issue if the cookies that the browser uses have been cached too long and are no longer valid. Clearing browser cache is often the simplest way of solving the issue. In the sections below you can find the instructions for cache clearing in Chrome and Mozilla. The procedure in other browsers may differ so you might need to do some additional research.
To clear the browser cache inside Google Chrome click on the three dots in the top right corner of the screen. Click on the History option followed by a click on the option with the same name in the submenu.
Your Chrome browser history will open in a new window. Find the Clear browsing data option in the top left corner of the screen and click on it.
This will open a popup window. Click on the Basic tab within and choose the appropriate time range. Make sure to tick the Cookies and other site data and Cached images and files options then click on the Clear data, afterward.
Clearing the cache in Firefox is done by clicking on the hamburger menu in the top right corner and then clicking on Options from the menu that opens.
In the window that opens, click on the Privacy & Security option.
Scroll down to the Cookies and Site Data section and click on the Clear Data button.
A popup window will open. Tick both the Cookies and Site Data and Cached Web Content options and then click on the Clear button.
Since caching issues are a common cause of redirect loops, you should test whether clearing the cache fixed the error. This is done by simply trying to access the page that was previously showing the err_too_many_redirects message. If the Too Many Redirects issue is still present, we suggest clearing all other forms of cache, as shown in the sections below.
Caching plugins are quite important for most WordPress websites. They reduce the page load times significantly as they serve static (cached) versions of your web pages to users. However, despite being quite beneficial, caching plugins can lead to a lot of common WordPress errors, including the redirect loop issue. Therefore, if you experience a type of redirect loop that allows you access to the backend only, you can easily test if this is the case. You only need to clear the plugin cache through the plugin options.
We used WP Fastest Cache and its options to do this. In the admin dashboard, hover over the Delete Cache option in the top navigation tab and click on Clear All Cache in the dropdown menu.
Then, check the frontend of your site. If you can see the frontend of your site, then you’ll know a plugin was the cause and that you’ve successfully solved the issue. If your frontend still displays the error, you should try using one of the other methods suggested in this article.
Also, a clarification before we proceed. Purging is another common term for clearing the cache and it is mostly used for WordPress caching plugins. Depending on the plugin, the options you need to look for, which are present across a multitude of caching plugins, are purging single pages or purging all plugin cache.
If the act of clearing the cache in the browser and caching plugin failed to solve the redirect loop issue, then clearing the server cache should be your next step. However, we suggest that you consult your hosting provider for the exact steps, as they can differ depending on the provider.
A CDN, meaning content delivery network, is often used for serving static site resources (JS and CSS stylesheets and images) to improve website speed. Although quite rare, CDN caching issues can happen. Therefore, if you are using CDN, it is important to exclude it as the possible cause behind the Too Many Redirects issue by testing.
Any good caching plugin allows integration with a CDN. The one we used, WP Fastest Cache, is no exception. Depending on the plugin you choose to use, the appropriate option you should look for may be called Purge CDN cache or Clear CDN cache. In the case of WP Fastest Cache, that option is called Remove Integration. Despite the difference in names, those options serve virtually the same purpose, testing-wise.
Therefore, navigate to the WP Fastest Cache section from the left side menu and click on the CDN tab. Select your CDN service followed by a click on the Remove integration button.
Check your site afterward to see if the Too Many Redirects error is gone. If it isn’t, you should proceed to the next troubleshooting method.
One of the more common reasons for the redirect loop is having incorrect website URLs. If you can log in to your admin panel, you should use the general settings to adjust the URLs of your site. By URLs of your website, we mean the Site Address, which is the URL that your visitors type in to reach your site, and the WordPress Address, which represents the locations of your WordPress files and folders.
To change both addresses, navigate to Settings > General and update your WordPress and Site Address to properly reflect the current addresses of your site. This is particularly important for any site that was migrated or has switched from HTTP to HTTPS.
In most cases, the two addresses should be the same. However, there are exceptions, such as when your WordPress folders and files are stored in a separate subdirectory.
Afterward, click on the Save Changes button in the bottom left corner of the screen.
If you are unable to login to your admin dashboard, you should try to find some other means of changing your Site and WordPress URLs. One of the ways you can do it is by editing the wp-config.php file, located in your root WordPress directory. Connect to your server using your FTP credentials and open your WordPress directory, often called public_html. Locate the wp-config.php file within, right-click it, and select the View/Edit option from the dropdown.
Open the file using a text editor and insert this code above the /* That’s all, stop editing! Happy blogging. */ line.
A few remarks about the code:
Replace the your-website part of the code with your actual website URL
Don’t put a trailing slash (“/”) at the end of your URL address
If your URL contains www, don’t forget to add that in as well
After making the changes, save the file and upload it back to your server, to override the one currently there. Then, try to access your website to determine if the error is gone.
Some plugins may use various redirection techniques that can lead to redirection loops. Other times, a simple plugin activation or update can cause it, as well. For this reason, we suggest that you thoroughly check your plugins, if trying previous methods didn’t solve the issue.
Connect to your server using your FTP credentials and navigate to the root WordPress directory (often called public_html). Open the wp-content folder, right-click on the plugins folder found within, and select the Rename option.
Rename the plugins folder to deactivate it. Any name will do, but we advise using the original and adding some text onto it, so you’ll have a record of what was done. Examples include plugins.old and plugins.deactivated.
Afterward, try to access the page that was showing the Too Many Redirects error earlier. If you are able to access it without the error re-appearing, the issue is caused by a faulty plugin. To pinpoint which one, you need to re-activate them all and then deactivate one by one whilst checking if the access issue is present.
Specifically, this section will show you what steps you need to take. First, log in to your dashboard while your plugins folder is still renamed. Then, with the use of an FTP client, return that folder to its original name—plugins. This will allow you to activate the plugins manually within your dashboard. So, stay logged into your dashboard, navigate to Plugins > Installed Plugins, and activate all your plugins manually. Then, log out of your admin dashboard.
Assuming that you are still connected to your server using FTP, navigate to your-site/wp-content/plugins/. Then right-click a plugin’s folder and select the Rename option.
Then rename the plugin’s folder (suggested rename options being plugin-name.old or plugin-name.deactivated) to deactivate that particular plugin.
Then, try accessing your site. If the err_too_many_redirects is gone, the error was caused by the plugin which you just deactivated. However, if the error persists, you should repeat the same process for all plugins, one by one, until you find the faulty one. The testing process can also be done on a staging domain if you are afraid of further endangering your live site. Nevertheless, it is important to be thorough in your testing. When you locate the faulty plugin, contact its developers for assistance.
The .htaccess file contains a lot of code that affects various server functionalities such as URL redirection, security settings, access restriction for certain IP addresses, and more. This makes it quite difficult to pinpoint the exact line of code that leads to the err_too_many_redirects. As such, it is much easier to delete the .htaccess file and create a new one with the default code, via FTP, and test the issue afterward.
The .htaccess file resides in the root WordPress directory, but it is often hidden. To access it, you should enable the option(s) for showing hidden files in your FTP client. We used FileZilla; the option you need is under the Server tab and it’s called Force showing hidden files.
After activating this option, connect to your server using your FTP credentials and navigate to your root WordPress directory. Locate the .htaccess file within. We advise you to rename the file instead of deleting it, as this will let you hold on to any code found in it. So, if the .htaccess isn’t causing the err_too_many_redirects error, you will get to keep any coding modifications you’ve previously made to the file. Therefore, right-click on it and select the Rename option.
Rename the file whatever you like (for example .htaccess_old or .htaccess_deactivated) and then create a new one. To create a new .htaccess file, login to your admin dashboard, navigate to Settings > Permalinks, and click on the Save Changes button in the bottom left corner of the screen.
This will automatically create a new .htaccess file. After that, check for the error. If the Too Many Redirects error is no longer present, the culprit was a piece of faulty code found in the old .htaccess file.
Now that you’ve seen how straightforward troubleshooting a Too Many Redirects error is, we hope you’ll never feel any sense of dread upon seeing this error message. Whether the redirect loop is caused by plugins, mismatched URLs, or corrupted .htaccess files, just follow the steps outlined in this guide and you will easily fix the error. Furthermore, since you now understand what the error is and when it can happen, you will be able to address it with confidence. And, should you need it, this article can always serve as a reference if you forget the specifics of any step for solving the Too Many Redirects error.