Home » WordPress Tutorials » Optimization » How to Fix the Too Many Redirects Error in WordPress

How to Fix the Too Many Redirects Error in WordPress

Optimization

The following tutorial provides information about the Too Many Redirects Error in WordPress. It also includes screenshots and possible solutions to the problem.

 

Why Am I Experiencing This Type of Error?

WordPress is a complex content management system that is configured in a way that it cannot operate under two different URLs. In other words, there can be only one web address to choose from when it comes to hosting a single WordPress blog.

The message Too Many Redirects is a common WordPress error (also referred to as a redirect loop), which usually occurs when the URL setting is configured to the wrong web address. A faulty .htaccess file or a badly configured plugin can also cause your site to go into an infinite loop.

 

What Does a Too Many Redirects Error Look Like?

Internet browsers display and interpret the error message differently. The screenshot hereunder illustrates how the error Too Many Redirects looks in Google Chrome.

how to fix the too many redirects error in wordpress 1

In Mozilla Firefox, the error message will look pretty similar to the one attached below:

how to fix the too many redirects error in wordpress 2

 

How Can I Solve the Redirect Loop?

Based on our experience with WordPress, we can offer you the following four possible fixes:

 

Solution #1: Check the URL settings

  • in your WordPress admin panel

The first thing you need to do is check the URL settings of your website in your WordPress dashboard. To perform a URL check:

  1. Sign into your WordPress account as Administrator.
  2. Once logged in, navigate to the Settings page and click General Settings.
  3. When on the General Settings page, you will notice there is a list of settings and available options. Double-check and ensure that both, the WordPress and Site addresses, match.

how to fix the too many redirects error in wordpress 3

If there is a mismatch between the two URLs (e.g. the WordPress Address is set to http://mydomain.com/, but the Site URL points to http://www.mydomain.com/), then you will need to make sure that both web addresses are identical.

  • in your MySQL database

Another way to perform a web address check is through the built-in phpMyAdmin4 tool. Launch phpMyAdmin4 in a web browser and enter your database credentials.

After a successful login, find the table labeled wp-options. Click the selected table to view its contents.

how to fix the too many redirects error in wordpress 4

Once in the editor, locate the rows siteurl and home. Verify the URL details in each of the two rows. The name of the siteurl address must match the home URL exactly.

how to fix the too many redirects error in wordpress 5

  • in your main configuration (wp-config.php) file

wp-config.php is the place where WordPress stores its database connection settings. In the main WordPress configuration file, users are also able to manually specify their URL location. This is one of the most preferred methods, since it does not require direct access to the admin panel and phpMyAdmin.

If you have set the website URL manually in your WordPress config, open up the file wp-config.php in your main domain directory and check your script for the following two global variables – define( ‘WP_HOME’, ‘http://www.mydomain.com’ ); and define( ‘WP_SITEURL’, ‘http://www.mydomain.com’).

how to fix the too many redirects error in wordpress 6

Please verify that the WP_HOME address matches the WP_SITEURL hostname in the code.

 

Solution #2: Disable your plugins

Another way to resolve the error Too Many Redirects in WordPress is by deactivating the plugins that are currently active for your website.

By default, WordPress stores all its plugin-related data in a sub-folder called plugins. The plugins directory is usually found in the wp-content folder of every WordPress instance.

how to fix the too many redirects error in wordpress 7

Right-click the plugins directory and press Rename. Give your folder a new name (e.g. plugins_disabled) and click the green check mark. Wait a couple seconds for our system to process your request.

After your plugins have been successfully disabled, visit your web page in a browser and re-test your WordPress application. If the redirection loop is no longer present on the page, it means that the problem is plugin-related.

To find out which plugin is causing the issue, rename the plugins directory back to plugins and start deactivating your extensions one by one until you find the problematic one.

 

Solution #3: Disable your default .htaccess file

If you have tried all of the above solutions and none of them has helped so far, you can temporarily disable WordPress’s main .htaccess file. The file in question is located in the root directory of WordPress and can be easily recognized by the dot sign in front of the document.

how to fix the too many redirects error in wordpress 8

The renaming process is pretty easy to follow. All you need to do is right-click on the .htaccess file and then hit the Rename button. Remove the dot from your file name and save the submitted changes.

Launch your favorite Internet browser and enter your website’s URL in the address bar.

Was this post helpful?

i

Relevant tags:

Create your WordPress website today!

Connect

Editor’s picks:

Gutenberg Tutorial: How to Move Blocks in WordPress

What you need to know: The WordPress Block Editor allows you to move blocks up and down the document structure in order to rearrange the content contained within those blocks. The most popular way of moving blocks is by dragging a block from one position and dropping...

Gutenberg Tutorial: Deleting a Block in WordPress

What you need to know: You can delete a block in WordPress by selecting it and pressing the Delete key on your keyboard. Alternatively, you can press the three-dot button in the Contextual Toolbar to access the Remove block option. Lastly, it is also possible to...

Gutenberg Tutorial: Using Block Patterns in WordPress

What you need to know: A block pattern in WordPress is a group of two or more regular WordPress blocks. These blocks come in a sensible layout that you wouldn’t need to modify in most cases. Instead, you just need to add your own content to the block pattern. You can...

Gutenberg Tutorial: Using WordPress Reusable Blocks

What you need to know: Gutenberg features reusable blocks that allow you to quickly insert the same content with one click. You can mark any block or block pattern as reusable. You can find your reusable block collection in the WordPress Block Library. Have you ever...



Create your WordPress website today!


Start now