Fixing WordPress Login Loops with 2FA Plugins (2025)
With Two-Factor Authentication (2FA) turned on for your WordPress site, you’ve already done a lot to make it safer. After hackers get your password, 2FA makes it harder for them to get in, even if they know your password.
However, there is a problem: your 2FA setup may sometimes keep you from logging in at all, instead of keeping you safe. There is no dashboard when you enter your username, password, and 2FA code. Instead, you are taken back to the login page. Over and over. We call this loop that never ends a WordPress login loop.
This article will explain the following:
- Why login loops happen when 2FA plugins are used
- Step-by-step solutions that are effective in 2025
- Actual cases of how site owners fixed the problem
- Advice on how to stop it from happening again
What is a WordPress Login Loop?
A login loop happens when you can’t get past the login page, even though your credentials are right. If you click on “Go,” the page will restart and ask for your information again.
Like having the right key to your house and being able to open the door, but it shuts before you can get inside.
One common case of a login loop scenarios :
Usually, this is what happens:
- Go to yoursite.com/wp-login.php.
- You type in your password and login.
- You are asked to enter your 2FA code.
- The right code from your authentication app is entered.
- You’re taken back to the login page instead of your homepage….
This happens over and over, which is why it’s called a “login loop.“
Reasons WordPress Login Loops Occur with 2FA Plugins
Random login loops don’t happen. They take place when WordPress can’t figure out that you’ve logged in correctly. For 2FA apps, this is usually because of one of these problems:
1. The server or device doesn’t sync time correctly
Time-based One-Time Passwords (TOTP) are what most 2FA apps use. Because these codes only work for 30 seconds, your server and gadget must have the exact same time. The code may not work if your phone’s clock is even slightly off from the server’s.
Example:
One of my clients’ phones was set to manual time, so it was 40 seconds off. Their codes always looked good, but by the time the server checked them, they were “expired.”
2. Problems with Plugins
There are some plugins, like security, redirection, or caching tools, that can mess up 2FA login. Like this:
- 2FA rules could be broken by security apps.
- Some caching plugins may show old login pages.
- After authentication, redirection plugins might send you back to the login page by mistake.
3. Problems with Cookies or Sessions
Cookies let WordPress know that you are logged in. This process starts over every time if these cookies can’t be set, are blocked by your computer, or become corrupted.
Some common reasons are:
- Browser extensions that block cookies
- The cookie site settings in wp-config.php were set wrong.
- Your server’s security headers that stop cookies
4. A Mismatch Between HTTPS and SSL
WordPress might create different sessions for each time your site loads with http:// and https://. On the secure login page, your cookie won’t work on the non-secure version, and the same goes for the other way around.
5. A WordPress or 2FA plugin that is outdated.
If your WordPress version, theme, or plugins don’t work well together, you might not be able to log in. 2FA plugins react very badly to changes in the main code of WordPress.
A step-by-step guide on how to fix WordPress login loops caused by 2FA plugins
Fist Step: Clear your browser’s cookies and cache.
- Go to your browser’s settings.
- Find “Clear history” or “Clear browsing data.”
- Choose ‘Cookies and Cached Images/Files’.
- Try logging in again after restarting your browser.
Reasons this works: You might keep going back to the login page if your cookie is broken. When you clear them, WordPress starts a new session.
Second Step: Get All of Your Devices and the Server to Sync Time
On your phone.
- Click on Settings and then Date & Time.
- Turn on “Set Automatically.”
On your server:
- Access your server control panel or SSH by logging in.
- Utilize the date command to see what time it is.
- If something is wrong, fix it or call hosting support.
Third Step: Temporarily Turn Off Caching
Plugins like WP Rocket, LiteSpeed Cache, and W3 Total Cache can save outdated login pages.
What You Need to Do:
- Turn off the caching plugin.
- Try to log in.
If the issue has been resolved, turn off caching for /wp-login.php and /wp-admin/ before turning it back on.
Fourth Step: Verify HTTPS Settings
After going to Settings > General, make sure that:
- WordPress Address (URL)
- Site Address (URL)
Start with https:// (not http://).
If the hosting you choose comes with an SSL certificate, make sure it’s turned on and all data is sent to HTTPS.
Fifth Step: Make sure WordPress, themes, and plugins are up to date.
- To get to Updates, go to Dashboard.
- Get the newest version of WordPress.
- Update the theme you’re using.
- Any security tools and your 2FA plugin should be updated.
Sixth step: Turn off all plugins except the 2FA plugin.
You can find the plugin that is causing the loop this way:
- Use FTP or File Manager to get to your site.
- Click on /wp-content/plugins/ then.
- Change the name of all the plugin folders except for the 2FA plugin. For example, add -old to the name of each folder.
- Log in again.
If you are able to log in, one of the plugins you disabled is the problem. Re-enable each one one at a time until the issue shows up again.
Seventh Step: Set up your 2FA plugin again If nothing else works:
- Use FTP to log in.
- It can be turned off by renaming the folder that holds your 2FA app.
- Don’t use 2FA to get into WordPress.
- Turn on the plugin again and set up 2FA again.
- With your authentication tool, scan the QR code again.
Examples of Advanced Troubleshooting
Example 1: The Caching Conflict:
The LiteSpeed Cache plugin was turned on for a WooCommerce site. The manager always saw a cached login page when they logged in, making it look like nothing happened.
Solution: They didn’t cache the login and dashboard URLs.
Example 2: The HTTPS Mismatch
A writer had set her WordPress to http:// in the General Settings, but her SSL certificate was still working. Cookie problems happened because of this.
Solution: It worked right away after changing the URL to https://.
Example 3: The Wrong Time Zone
Word press was set to Manila time, but the user’s computer was set to UTC. After an hour, the TOTP 2FA numbers stopped working.
Solution: Once they were lined up, the loop was fixed.
How to Avoid Login Loops in the Future
- Keep Time in Sync: Set your phone and computer to update the time automatically.
- Select a 2FA plugin that works well with your site. Wordfence Login Security, Google Authenticator (MiniOrange), and WP 2FA are all great options.
- It’s not a good idea to use two plugins for the same security job because it leads to more problems.
- Update your software often—one of the main reasons for these loops is software that is too old.
- Don’t cache /wp-login.php or /wp-admin/; whitelist those pages as login pages in caching plugins.
- Test After Making Changes—Test your login process again after changing plugins or themes, but don’t log out yet.
Related Article:
If you’re not having a loop problem but your 2FA code doesn’t work, check my other guide:
Stop Spam Logins: Fix WordPress 2FA Not Working (2025 Guide)
Finally, getting stuck in a login loop with 2FA apps can feel like being locked out of your own home. Luckily, the cause is usually something small, like a broken clock, a caching rule, or a cookie.
Use these fixes to quickly get back into your site and make sure it doesn’t happen again.
Have you ever gotten stuck in a WordPress login loop? What did you do to fix it? Tell other site owners about your experience in the comments. Your tip could save them hours of trouble.
Help other WordPress users out by sharing this help if you liked it.
To find more WordPress fixes and tips, visit our YouTube channels:
- Preet Tech Ideas (English)
- Preet Web XP (Hindi)
Do you need professional help with your WordPress site? Talk to us:
Website: Preet Web Vision
Phone: +63-9633112000
Email: hello@preetwebvision.com