While working on your website on the WordPress platform, you could face some errors. One of the most popular ones is ERR TOO MANY REDIRECT. In Google Chrome, you will see the following notification: This page shows a circular redirect loop, in Firefox it will look like: The page is not redirected properly. Usually this error indicates an incorrect configuration in your WordPress settings file, and, as a result, there is a cyclic redirection — your site cannot stop the redirection process from one page to another. Usually, WordPress Plugins or misconfigured servers can cause this error. Do not worry because solving this error can be quick and easy.
How to fix err too many redirect Error
Before starting, make sure that you are able:
- To access your hosting control panel via a web browser or FTP client.
- To access the WordPress admin of your site (optional).
Step 1 — Check the settings of your URLs
The first thing you should check is the settings of your site’s URLs.
You can do this via various methods :
Option 1 — Verify URL through the Admin Console
In the WordPress admin section (wp-admin), click on ‘Settings’. By default, your General Settings are displayed. Check WordPress Address (URL) and Site Address (URL). Make sure that the URLs that you see are correct. If the installation of your WordPress is made in a subdirectory but not in a root folder, for instance, the site is uploaded to /public_html/wp/, then the URL must be www.example.com/wp. In case the site has https enabled and has a SSL certificate installed, then add ‘https’ to the URL.
If you made any changes, be sure to click the Save Changes button at the bottom of the page.
Option 2 — Check/Change URL settings manually
Perhaps you cannot access the admin console of your WordPress website. In this case, you can change the URL address settings using the wp-config.php file with the file manager and a code editor. You can edit the file using the online file manager provided by the hosting provider. Another option is to download it, edit it and then upload it back to the server via the FTP client. In the example, we will edit the file in the file manager:
- Go to your file manager through your hosting control panel.
- Find the wp-config.php file.
- Click to edit.
- Add the following lines to the file, making sure to replace http://example.com with the link to your WordPress website. For example, if WordPress is in the root directory (/public_html/), just use your own domain name, if it is in a subdirectory (/public_html/wp), replace it with a URL with a subdirectory (http://example.com/wp). You can add lines at the end after all the code that is already in the file:
define (‘WP_HOME’, ‘http: //example.com’);
define (‘WP_SITEURL’, ‘http: //example.com’);
- Be sure to save the changes by clicking on the Save icon.
- Go to your site to check whether the change of WordPress URL addresses helped to fix ERR TOO MANY REDIRECT error.
IMPORTANT: Do not forget to change http://example.com to your current website address.
Option 3 — editing URL settings through your database
As WordPress is based on PHP, it uses the MySQL database to store all the necessary information. So, your MySQL database stores the full information about your posts, pages, plugins, profiles, and configurations. So when you changed something on your WordPress website, it is reasonable to change the stored information in MySQL tables. It is not difficult to do. It will require minimal effort and several minutes of your time. Let’s see some details how to change the URL settings of your website via the MySQL database.
What all you need
In the very beginning make sure that you can access the hosting control panel. You will require the Database Manager, like Adminer or PHPMyAdmin’s access, as well as your login and password. You can find the database login details in the wp-config.php file or usually, you can also find the information right in the hosting control panel. If you cannot find it, please contact hosting technical support. They will tell you how to access your database online.
1 — Determining the name of WordPress MySQL database
If you have only one MySQL database on your hosting, you might skip this step. If you have several databases, find the one that contains the information about your WordPress. In most cases, its name will contain a ‘wp_’ index. If it is not so, open the wp-config.php file and find a database name. To access this file, you can use the online file manager or FTP client.
2 — Entering phpMyAdmin or Adminer Database manager
When you open your hosting control panel, find the Database Manager section and click on the link to open it and make a backup of the current database before making any changes
3 — Selecting the database
On the left side of the screen, find the database that contains all the information about your WordPress. Click on its name to open it.
4 – Formatting SQL Query
To change the URL settings of your website, go to SQL tab where is you should paste the following code:
UPDATE wp_options SET option_value = replace(option_value, ‘oldurl.com’, ‘newurl.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
UPDATE wp_posts SET guid = replace(guid, ‘oldurl.com’,’newurl.com’);
UPDATE wp_posts SET post_content = replace(post_content, ‘oldurl.com’, ‘newurl.com’);
UPDATE wp_postmeta SET meta_value = replace(meta_value,’oldurl.com’,’newurl.com’);
This piece of code will change all your old links to the new links.
IMPORTANT! Do not forget to change the links in the example into your own ones. If you do not change them, their website will not work at all.
IMPORTANT! Sometimes the index at the beginning of the name of MySQL table will be different from ‘wp_’. In this case, you should replace the index in the query above with the table prefix value that you see in the wp-config.php file of your WordPress website.
5 – Running SQL command
When you checked your website links and inserted all the programming code changes into the text field, click on the Go button to run the operation.
6 – Verifying the URL changes
If the operation went successfully, you will see a message in a green box. The system will also show you how many changes were made. After that, in 99% of cases, the error is fixed. If something went wrong, check if you entered everything correctly.
Step 2 — Disabling plug-ins
Another reason that can cause ERR TOO MANY REDIRECT error is an outdated plugin or a conflict between one or more plugins of theme. A good idea is to turn off all your plugins and try to access your site and, and thereby fix the bug. You can disable all of your plugins very quickly and simply:
- Go to your File Manager through your control panel.
- Find the wp-content directory and enter it. You will see the Plugins directory.
- Select the Plugins directory and select the Rename operation. Now rename it to plugins_backup, for example, or any other name other than Plugins. Do not worry, the plugins will not be damaged, you will be able to rename the directory back to the Plugins after you finish the test.
- Save the changes by clicking on the green Save icon.
Once you renamed the plugins directory, try to access the site. If the error disappears, it means one or more plugins cause the error. Try to remove the most recent plugins and rename the directory back to Plugins.
You can remove your plugins using FTP/File Manager in the wp-content/plugins directory and remove the plug-in that you have selected. For example, you would like to remove Woocommerce in the File Manager. Just mark the plug-in which you want to delete and press Delete.
Step 3 — Deactivate the .htaccess / Nginx Configuration files
Another reason for an infinite redirect or ERR TOO MANY REDIRECT error can be an incorrect .htaccess or Nginx Configuration file settings. In this case, you can disable the .htaccess / Nginx Configuration file to recover the access to the site.
- Go to the File Manager from your control panel.
- Select the Apache / nginx Configuration file, right-click on it and select Rename.
- Go to your site and see if it is available.
IMPORTANT: Since your site may stop working after making some changes, always make backups of the original .htaccess/ Nginx configuration file before making any changes to it. Also remember, if you replace some settings in the Apache or Nginx file, some permanent links, plug-ins, and settings may stop working.
In this tutorial, we showed three possible ways to solve the ERR TOO MANY REDIRECT error in WordPress. Please feel free to share any other methods that might have helped you fix the err too many redirect error.