Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups)
Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups)
You’re all set to dive into your WordPress site, but then, BAM! You’re slammed with the dreaded “err_too_many_redirects” message.
It’s like your website is playing a game of redirection tag and you’re stuck in the middle, unable to get in. This error is a real pain, and it’s more common than you’d think among us WordPress folks.
But don’t worry, you’re not alone, and you’re definitely not stuck.
In this post, I’ll help you untangle this mess. I’ll break down what’s causing this redirects WordPress error and walk you through the steps to get your website back on track.
Let’s get your site back in tip-top shape!
The “Too Many Redirects” error is when your browser gets stuck in an endless loop. You want your browser to take you to a specific page on your website. Instead, it tries to redirect to other pages too many times, resulting in an error.
Normally, redirects are helpful. They guide you from an old page to a new one seamlessly.
But sometimes, things go wrong. With the redirect loop error, your browser is sent back and forth between different URLs instead of reaching a destination.
It’s like getting directions that repeatedly loop you back to the same spot, never actually getting where you want to go. It’s a frustrating merry-go-round that leaves you stuck.
Okay, now that we know what the error is, let’s investigate why it happens. Honestly, this is where things can get a little tricky. But don’t worry — I’ll explain it to you.
There are a few usual suspects that tend to cause this chaos:
Sometimes, the website address stored in your settings is just slightly off, causing redirect loops in WordPress.
The .htaccess file is like your website’s rulebook. If the redirect rules are incorrect, your browser can go around in circles.
Those handy plugins we all love? They can sometimes clash with each other and cause redirect mayhem.
If you’re using a Content Delivery Network (CDN) or a Web Application Firewall (WAF), their settings can sometimes create endless redirects.
If your site uses HTTPS but the certificate isn’t set up properly, it can cause a redirect loop between HTTP and HTTPS.
On rare occasions, the issue could be with the server itself.
Enough talk about the problem, let’s get down to business and fix it! I know it can feel overwhelming, but don’t worry, we’ll take it step-by-step.
I’ll start with some quick and easy fixes and then move on to more advanced solutions if you need them.
Your browser might be holding onto some old, cached redirect instructions causing this issue. A quick hard refresh can sometimes clear that out.
Think of it like giving your browser a little nudge to forget the past and get the latest information.
Here’s how to do a hard refresh:
Give that a try. It might seem too easy, but you’d be surprised how often it works! It’s the quickest fix, so it’s worth a shot before you dive into more complex stuff.
If a hard refresh didn’t do the trick, let’s try something else. Sometimes, your browser data (cache and cookies) can be the culprit.
Your browser could be using outdated information that sends it in circles. Clearing your cache and cookies forces your browser to load fresh data, which can often resolve redirect issues.
For Google Chrome, click the three dots in the top-right corner. Select Delete Browsing Data.
Choose a time range (like Last hour or All time). Clear browser cookies by checking Cookies and other site data. Clear browser cache by checking Cached images and files.
If you’re using a different browser, this guide shows you how to clear your cache. Whether you’re using Mozilla Firefox, Safari, or something different, you’ll find detailed instructions.
Once you clear browser data, revisit your site. See if the redirects WordPress error disappeared.
Also, try incognito/private browsing. If your site works in a private window, that’s usually a sign that your normal browser contains outdated information. This can help you determine if the browser is causing the issue.
You may also want to clear your WordPress cache. Sometimes, redirect loop errors can be fixed by clearing your caching plugin’s saved data.
When your browser tries to access a website, it gets a response from the server that includes a status code. These codes are messages that tell your browser if everything’s okay or if something went wrong.
HTTP status codes can tell us what’s going on with redirects. Certain status codes, like 301 (Moved Permanently) and 302 (Found), indicate that a redirect is happening.
If you’re getting a “Too Many Redirects” error, it means that these redirects are looping. To see what’s going on behind the scenes, you can use a handy tool called httpstatus.io.
Go to httpstatus.io. Enter your website’s URL into the input box. Click the Check status button.
The tool will show you the HTTP status code and the redirect path. It’ll show you where the link tries to redirect, so you’ll know where the problem is.
One of the most common causes of redirect loops is incorrect URL settings within WordPress. It’s like having the wrong address in your GPS — it’s going to take you to the wrong place.
Within your WordPress site settings, you have two important URL fields: the WordPress address and site address.
Your WordPress Address (URL) is where your WordPress core files are located.
The Site Address (URL) is the address visitors type into their browsers to access your site.
These two URLs should usually be the same. If they don’t match or are not pointing to the correct domain, it can cause redirect errors.
You also have to be consistent with your URLs. For example, if you have a redirect loop between www.yourdomain.com and yourdomain.com that could be a problem with your configuration.
To check and change these URLs, log in to your WordPress dashboard. Go to Settings and then General.
Look for the WordPress Address (URL) and Site Address (URL) fields. Make sure that both of these URLs are pointing to the right address. Most likely, they’ll be identical, unless you gave WordPress its own directory.
Use either the www. or the non-www. version, but not both. Look for typos like “http://” versus “https://”.
If you need to change the URLs, be very careful and double-check that everything is correct before saving. Incorrectly set URLs can lock you out of your dashboard, so proceed with caution.
You can also do this with an FTP client. Add this code to your wp-config.php file:
define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
Re-upload this file to your server. This should fix redirect errors because of WordPress URLs.
Let’s talk about HTTPS. If your website uses HTTPS (which it really should for security), then an incorrectly configured SSL certificate can sometimes lead to redirect loops.
It’s like having a security guard that keeps sending people back and forth because they can’t verify their credentials.
Make sure that your server has a valid SSL certificate installed. If your certificate is expired or not set up properly, browsers will complain and redirect you away from the site. You may not be able to access your site at all.
You can usually check your SSL in your hosting account or with a tool like SSL Checker. Ensure that the certificate is valid, not expired, and correctly installed.
Sometimes, there’s an issue where the site tries to force all traffic to use HTTPS, but a misconfiguration causes it to loop back and forth between HTTP and HTTPS.
If you use a plugin or a setting in your hosting provider to force HTTPS, ensure it is configured correctly. Incorrect configurations can force you into a loop with HTTP.
You might be loading some resources over HTTP while the rest of your site uses HTTPS. This is called mixed content and it can cause browsers to get confused and send you into a loop.
If you’re not sure about the technical details, it’s always best to reach out to your hosting provider or a professional who can help you troubleshoot the server configuration. Getting HTTPS set up right is very important for your website’s security.
As much as we love them, sometimes plugins can cause conflicts that lead to redirect loops.
To see if plugins are causing the issue, temporarily deactivate them. You can do this from your WordPress dashboard. Go to Plugins, select all of them, and choose Deactivate from the bulk actions menu.
After deactivating the plugins, try to access your site again. If the “Too Many Redirects” error is gone, that means a plugin was the problem.
Reactivate your plugins one at a time, checking your site after activating each one. This way, you can pinpoint which plugin is causing the conflict. When the error comes back, that’s the troublesome plugin.
Once you find the problematic plugin, remove it and find an alternative. Alternatively, get in touch with the plugin developer to get help fixing the issue.
If you can’t log in to your WordPress admin dashboard because of the redirect loop, you can still deactivate your plugins. You’ll need to use FTP or your hosting provider’s file manager to access your website files.
Then, navigate to the wp-content directory and find the plugins folder. Rename the plugins folder to something like plugins-deactivate. This will deactivate all your plugins.
Rename the plugins folder to its original name when you’ve logged back in, and proceed with the steps above to find the problematic plugin.
This can be a tedious process, but it’s a necessary step in troubleshooting. It helps you identify which plugin is the problem. Once you do, you’re closer to fixing the issue!
A Content Delivery Network (CDN) and a Web Application Firewall (WAF) can be great for website performance and security, but misconfigurations in these services can sometimes cause redirect loops.
If you’re using a CDN, review its settings. Look for any rules that might be causing redirects. Some CDNs have specific settings related to HTTPS, which could contribute to the issue.
Web Application Firewalls often have rules to filter out malicious traffic, but sometimes, these rules can accidentally cause redirects. Review your WAF rules to ensure none are incorrectly redirecting traffic.
If you can’t see what is wrong, you can try temporarily disabling your CDN or WAF. Then check if your site is working again. If so, then that is definitely the source of the issue.
If your CDN or WAF is causing the “Too Many Redirects” error, you’ll need to tweak its settings or contact its support team for help.
Okay, so if we’ve ruled out plugins, CDNs, and WAFs, let’s dive into your server settings. Sometimes, the issue can come from configurations at the server level, especially in the .htaccess file.
Think of this file as your server’s rulebook. If it contains incorrect redirect rules, your browser will get caught in a loop.
You can access the .htaccess file using FTP or your hosting provider’s file manager. It’s usually located in the main directory of your WordPress installation.
Rename the .htaccess file to something like .htaccess_old. This will effectively disable the rules in the file.
Visit your website and see if the error has been resolved. If it is, then your .htaccess file is the source of the problem.
To fix this issue, generate a new .htaccess file. Fortunately, this process is super simple. Go to Settings » Permalinks in your dashboard and hit Save Changes without altering anything.
If you’ve tried everything else, and you’re still seeing the “Too Many Redirects” error, it’s time to consider reinstalling WordPress.
This is a last resort, but sometimes, the core WordPress files can become corrupted, leading to unexpected issues. It’s like hitting the reset button on your website, but we’ll make sure to back everything up first.
Before doing anything drastic, you need to create a complete backup of your website. This includes both your database and files.
Tools like Duplicator are perfect for creating backups that you can use to restore your website. Make sure you include everything on your site in the backup.
Next, go to wordpress.org and download the latest version of WordPress.
You can manually upload the WordPress files to your server using FTP or your file manager. However, don’t overwrite the wp-config.php file or the wp-content folder, as these contain your settings, themes, plugins, and uploads.
After reinstalling WordPress, visit your site. If the error is gone, then it means a core file was corrupted.
Reinstalling WordPress can be time-consuming, but it’s a thorough way to rule out any issues with the core files. If this step finally fixes your “Too Many Redirects” error, we know the issue was likely with a core WordPress file.
Fixing errors in WordPress often requires time and energy. So, let’s focus on how you can avoid this frustration in the future. While you can’t prevent every possible issue, there are some smart steps you can take.
One of the most important things you can do is to create regular backups of your website. It’s like having an insurance policy for your site.
If something goes wrong, you can simply restore your site to a previous working state. That’s why I’m such a big fan of using tools like Duplicator.
Duplicator makes it super easy to create and manage backups. It also has features like scheduled backups, so you don’t have to worry about manually backing up your site.
If you make a mistake while troubleshooting or if a plugin update breaks your site, you can quickly restore your site from a backup. This can save you hours of frustration.
At some point, you may need to move your site to a new host or domain name. If you don’t use a proper migration tool like Duplicator, you may encounter errors like incorrect URLs and redirect loops.
Duplicator ensures your URLs are correct every time, helping prevent annoying redirect issues. It’s a great tool to have in your WordPress toolkit. Simply drag and drop your backup to a new location and you’re done!
The error “ERR_TOO_MANY_REDIRECTS” occurs when the website enters a redirect loop. Common causes include incorrect site URL settings in WordPress, mismatched HTTPS configurations, or faulty .htaccess rules. Fix this by verifying WordPress URL settings, ensuring HTTPS setup matches, and reviewing .htaccess rules.
You can edit redirects in WordPress by accessing the .htaccess file via FTP. On the other hand, plugins like Redirection or AIOSEO give you a much more user-friendly option.
For SEO, more than three consecutive redirects are considered excessive and can harm performance. Excessive redirects slow page load times and confuse search engines. Minimize redirects by consolidating chains and ensuring URLs resolve in one step.
Debug “too many redirects” in WordPress by checking site URL settings in Settings » General, ensuring HTTPS configuration matches, and reviewing .htaccess rules for redirect loops. Deactivate plugins temporarily to rule out conflicts and clear browser and site caches before testing again.
The most important thing is to understand that each website is unique, and the exact cause of your redirect problem might be a combination of issues. So, don’t give up!
If you’ve gone through all these steps and still have problems, then it may be a server-level issue that requires help from your hosting provider.
Remember, proper backups are your best friend when you’re troubleshooting website issues. And that’s why I highly recommend giving Duplicator Pro a try. It simplifies the process of backing up and restoring your website, and even helps prevent redirect errors during migrations.
So, if you’re ready to take control of your WordPress site and avoid future redirect headaches, click the link below and check out Duplicator Pro!
While you’re here, I think you’ll like these other WordPress guides:
Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.