A WordPress login redirect loop is a frustrating experience for sure. The user spends minutes in the browser trying to figure out what went wrong, but there’s no solution in sight.
It can be an even more frustrating experience when you’re not tech-savvy and don’t know how to find help with this issue. So fixing this problem is quite tough if you do not have any guide.
Don’t worry, this article will tell you all about that frustration and provide some solutions to get past it!
What Is It, Background Information, Problem, Cause
It all started somewhere between the release of WordPress 3.9 or – more likely – 4.2 when some users of WordPress started experiencing a redirection loop when trying to authenticate with their username and password.
This did not happen for all users, but there was no pattern as to who would and wouldn’t be affected. It was a classic case of “the user did what they’re supposed to do, but the system still doesn’t work”.
The redirection loop happens when a user enters their credentials into the “login” screen and clicks on the “Log In” button. They are redirected back to the login screen and will again enter their credentials, which results in another redirection to the same page.
No error message is shown, nor does the browser show any sign of what’s going on behind the scenes.
The login problem is difficult to solve because WordPress itself doesn’t actually have a bug. It works exactly as it’s supposed to work, but there can be bugs in the WordPress theme or plug-ins or others that break the login process and cause this redirect loop.
The big issue with this type of problem is not so much that it causes inconvenience for end-users (although it does), but the web developers who created that theme or plug-in won’t be aware of the bug because they aren’t affected by it.
This means that if several people report this issue, the developers don’t know about it and can’t release a fix for their product.
How To Identify WordPress Login Redirect Issue?
Since the problem is in a WordPress theme or plug-in or some other things, you can try to fix it yourself first. If you fail to fix yourself, you need to get help from a WordPress expert or developer.
The first thing you should identify is whether the problem really is a redirect loop and not something else. Do this by checking what URL you’re being redirected to.
Open the browser’s developer tools and take a look at the URL that is shown on top of the developer tools.
If it’s not a WordPress login screen (eg. http://example.com/wp-login.php) and instead of a random URL, then it’s not a redirect loop and you should look for other help.
If it is the WordPress login screen that you’re being redirected to, then the problem is probably related to your WordPress theme, plug-in, or others.
7 Ways To Fix Login Redirect Loop Issue in WordPress
Below are the top 7 solutions on how to fix a login redirect loop issue in WordPress.
1) Clear Your Browser Cache:
This is the simplest solution, but also a placeholder for further testing. If you can clear your cache and fix it with this method then that’s good news – now you know what to do when this issue appears again!
To clear your browser cache, follow these steps:
- Chrome users go to three dots ->More tools -> Clear browsing data
- Firefox users go to three dots -> History -> Clear Recent History
- IE 10 and 11 users go to tools drop-down menu -> Safety -> Delete Browsing History
- IE 9 users go to Gear (upper right) -> Safety -> Delete Browsing History
The guide with this solution is that sometimes cached session data causes the WP redirect loop.
2) Check which theme and plug-ins you’re using:
If the login redirect loop issue is related to your WordPress theme, then you should try switching to a new default theme first.
For example, if you’re using the Twenty Fifteen theme right now and having this problem, switch to Twenty Sixteen and see if it still happens.
So far I have not heard any reports of issues with the Twenty Sixteen default theme, but you can always try it out in a safe environment before going live with your site.
If changing the theme solves the problem, then the issue is most likely coming from your current theme. You need to contact the theme author and let them know about this bug.
If changing the theme doesn’t fix it, then try switching to a completely different WordPress theme and see if it still happens.
I also suggest installing plug-ins gradually instead of all at one go. This way you can isolate which plug-in is causing this problem, then get in touch with the plug-in author and let them know about it.
3) Check your PHP and Database versions:
If you’re using an outdated version of PHP or MySQL, then there can be compatibility issues with your WordPress theme that cause the redirect loop.
This is why sometimes switching to a newer version (eg. 5.4 instead of 5.2) will fix the problem, but in other cases, it doesn’t make a difference at all. Also, this could indicate that your hosting provider needs to upgrade these technologies.
You can read a guide on how to update the PHP latest version & why WordPress admin is slow?
4) Turn off all third-party services and see if it works:
If you’re on a managed WordPress hosting plan, then this isn’t going to work for you. But if your WordPress site is on a shared hosting plan or VPS/Dedicated server, then you should try turning off all non-essential services on your web server.
Examples of these are Cloudflare CDN (or any other ‘performance’ tools) and caching plug-ins that store data in your database or filesystem.
If disabling third-party services fixes the problem, then it’s a conflict between your WordPress theme and your web host’s server optimization tools.
5) Check the .htaccess file:
If you suspect that it is a corrupt or malformed .htaccess file on your website, then simply move the existing .htaccess file to another location. You can rename it to something like ” htaccess-old ” or just delete the file altogether.
Then try to access your site again and see if it’s working now. If so, then that was probably causing the WordPress redirect loop issue.
If you’re using a caching plugin, also delete its cache folder as well as any .htaccess files inside it. Check to see if this fixes the problem before moving on to the next steps.
6) Try out the Performancing Debugger plug-in:
If you’re a WordPress developer and you’re working on a theme or plugin that’s causing the redirect loop, then a Performancing Debugger plug-in is the solution.
If you are not a developer and are not able to fix the issue yourself, you could also hire someone to fix it for you.
Hopefully one of the above solutions will help resolve this redirect loop error in WordPress.
7) Reinstall WordPress:
If all else fails, you should consider reinstalling WordPress. Before doing so though, make sure your database & contents are backed up and you can get back into your admin area by manually adding the “wp-admin” folder to a new installation.
Also, delete any obsolete files that may be causing a conflict with your new WordPress installation.
The WP redirect loop is not a very common issue, almost all WordPress users have never experienced it before. That also means that there’s not a whole lot of information online about how to fix it. But if you follow this article and try out each step one by one, I’m sure you’ll be able to resolve your problem in an hour or two.
Also, as I said before, sometimes the WP redirect loop is caused by a third-party service such as Cloudflare, and the best thing you can do is contact their support team for more assistance.
Feel free to leave your thoughts in the comments section below, and please share this article if you found it useful