WordPress login page redirect loop error - fixing infinite redirect on wp-admin

WordPress Login Page Refreshing and Redirecting Loop: Complete Fix Guide

Experiencing the dreaded WordPress login page refreshing loop? You type in your credentials, hit enter, and instead of your familiar dashboard, you’re greeted with the exact same login screen. Or worse, you’re redirected away entirely, only to land back on the login page in an endless cycle. This frustrating issue can feel like a digital lockout, preventing you from accessing your website and managing your content. It’s a common problem that stumps many WordPress users, but rest assured, it’s almost always fixable.

This comprehensive guide is designed to walk you through every possible solution, from the simplest browser-based fixes to more advanced server-side troubleshooting. We understand how crucial it is to regain access to your site quickly and efficiently. By following our detailed, step-by-step instructions, even those new to WordPress will be able to diagnose and resolve the WordPress login page refreshing loop, getting your site back on track without needing to hire a developer.

No more staring at that stubbornly refreshing login screen! We’ll cover everything from caching conflicts and plugin incompatibilities to corrupted cookies and incorrect site URLs. Our aim is to provide you with a definitive resource that not only solves your immediate problem but also equips you with the knowledge to prevent similar issues in the future. Let’s dive in and fix this frustrating login loop once and for all.

What Causes This / Why This Matters

The WordPress login page refreshing loop is primarily a symptom of an underlying configuration issue that prevents WordPress from correctly verifying your session. When you log in, WordPress sets a series of cookies in your browser that identify you as an authenticated user. If these cookies cannot be set, are corrupted, or are misread, WordPress won’t recognize your login attempt as successful, leading to the endless loop.

There are several common culprits behind this problem. One of the most frequent is incorrect WordPress URL settings. If your WordPress Address (URL) and Site Address (URL) don’t match or are set incorrectly (e.g., HTTP instead of HTTPS, or a subdomain mismatch), WordPress can’t properly redirect your session. Another major cause is caching issues. Aggressive caching plugins or server-level caching can sometimes cache the login page, serving an outdated version that interferes with the login process.

Furthermore, corrupted browser cookies or outdated browser data can directly prevent WordPress from setting new session cookies. Plugin conflicts, particularly security or optimization plugins, can also interfere with the login flow by altering rewrite rules or blocking cookie-setting attempts. Lastly, an overly full hosting disk space or PHP memory limits can sometimes prevent critical files from being written or processed, indirectly causing login failures.

Why does this matter? Beyond the obvious frustration of not being able to access your site, a persistent login loop means you can’t update content, monitor security, or respond to comments. For business websites, this can lead to lost revenue, damaged reputation, and a significant disruption in operations. Understanding the root causes empowers you to not only fix the problem today but also implement best practices to avoid it in the future, ensuring the smooth and secure operation of your WordPress site.

Step-by-Step Solution / Guide

Don’t panic! We’ll tackle the WordPress login page refreshing loop systematically, starting with the simplest solutions and moving to more technical fixes. Follow these steps carefully, testing your login after each potential solution.

1. Clear Your Browser’s Cache and Cookies

This is often the quickest and easiest fix for the WordPress login page refreshing loop. Your browser stores temporary data (cache) and session information (cookies) to speed up browsing. If these data become corrupted or outdated, they can interfere with your WordPress login.

How to Clear Cache and Cookies:

  • For Google Chrome:
    1. Click the three vertical dots in the top right corner.
    2. Go to “More tools” > “Clear browsing data…”
    3. Select “Time range” as “All time.”
    4. Check the boxes for “Cookies and other site data” and “Cached images and files.”
    5. Click “Clear data.”
  • For Mozilla Firefox:
    1. Click the three horizontal lines in the top right corner.
    2. Go to “Settings” > “Privacy & Security.”
    3. Under “Cookies and Site Data,” click “Clear Data…”
    4. Check both boxes and click “Clear.”
  • For Microsoft Edge:
    1. Click the three horizontal dots in the top right corner.
    2. Go to “Settings” > “Privacy, search, and services.”
    3. Under “Clear browsing data,” click “Choose what to clear.”
    4. Select “Time range” as “All time.”
    5. Ensure “Cookies and other site data” and “Cached images and files” are checked.
    6. Click “Clear now.”

After clearing, close your browser completely, reopen it, and try logging into your WordPress site again. You might also try an incinerated window (incognito/private mode) as this bypasses existing cache and cookies completely. If this resolves the WordPress login page refreshing loop, you’re good to go! If not, proceed to the next step.

2. Verify WordPress Address (URL) and Site Address (URL)

Incorrect URL settings are a very common cause of the WordPress login page refreshing loop. If there’s a mismatch between your WordPress Address (where the core files are) and your Site Address (what visitors type to reach your site), WordPress can get confused during the login process, leading to a redirect loop.

Ideally, you’d fix this from your WordPress dashboard under Settings > General. However, since you can’t log in, you’ll need to modify your wp-config.php file.

Accessing wp-config.php:

  1. Connect via FTP/SFTP: Use an FTP client like FileZilla to connect to your web host. You’ll need your FTP credentials, which you can usually find in your hosting control panel.
  2. Use your Hosting Control Panel’s File Manager: Most hosting providers (cPanel, Plesk, etc.) offer a File Manager within their control panel. Navigate to your WordPress installation’s root directory (often public_html or www).

Editing wp-config.php:

  1. Locate the wp-config.php file in your WordPress root directory.
  2. Download a copy of it to your computer as a backup before making any changes.
  3. Open the wp-config.php file with a plain text editor (like Notepad++, Sublime Text, VS Code, or even basic Notepad).
  4. Add the following two lines of code just above the line that says /* That's all, stop editing! Happy publishing. */:
    define('WP_HOME','https://yourdomain.com');
    define('WP_SITEURL','https://yourdomain.com');
  5. Important: Replace https://yourdomain.com with your actual domain name. Ensure you use http:// or https:// correctly. If your site uses HTTPS, use https://. Double-check for www or non-www versions as well. These must match your site’s actual accessible URL precisely.
  6. Save the wp-config.php file and upload it back to your server, overwriting the old one.

Once updated, try logging in again. These lines override the database settings, forcing WordPress to use these URLs. If this fixes the WordPress login page refreshing loop, you can then log in, go to Settings > General, verify the URLs are correct, and then safely remove these lines from wp-config.php if you wish, as the database will now hold the correct values. Leaving them in won’t hurt, but the database values won’t be editable from the dashboard.

3. Disable All Plugins (via FTP/File Manager)

Plugin conflicts are a very common cause of the WordPress login page refreshing loop. A faulty plugin, especially security, caching, or redirection plugins, can inadvertently break the login functionality. Since you can’t access your dashboard, you’ll need to disable them manually.

How to Disable Plugins:

  1. Connect to your site via FTP/SFTP or use your hosting control panel’s File Manager.
  2. Navigate to your WordPress installation’s root directory.
  3. Go to the wp-content folder.
  4. Inside wp-content, you’ll find a folder named plugins.
  5. Rename the plugins folder to something like plugins_old or plugins_disabled. This immediately deactivates all plugins on your site.

Now, try to log in to your WordPress dashboard. If you can log in, then one of your plugins was the cause of the WordPress login page refreshing loop.

Finding the Conflicting Plugin:

  1. Once you’re logged in, rename the plugins_old folder back to plugins.
  2. Go to your WordPress dashboard > Plugins > Installed Plugins. All your plugins will now appear as deactivated.
  3. Activate your plugins one by one, testing your login after each activation. (Log out and try to log back in again.)
  4. The plugin that causes the WordPress login page refreshing loop to reappear is the culprit. Once found, delete it (if not critical) or look for an alternative/contact the plugin developer for support.

4. Switch to a Default Theme (via FTP/File Manager)

While less common than plugin conflicts, a faulty or incompatible theme can also be responsible for the WordPress login page refreshing loop. Some themes include custom login pages or functions that can conflict with WordPress core when things go wrong.

How to Switch Themes:

  1. Connect to your site via FTP/SFTP or use your hosting control panel’s File Manager.
  2. Navigate to your WordPress installation’s root directory > wp-content > themes.
  3. Locate your currently active theme’s folder. (e.g., twentytwentythree or astra).
  4. Rename this active theme’s folder to something like mytheme_old. This will force WordPress to fall back to a default theme (like Twenty Twenty-Three, Twenty Twenty-Two, etc.). If you don’t have a default theme installed, you might need to upload one first.

After renaming, try to log in. If you can, then your theme was the issue. Once logged in, you can then reinstall or troubleshoot your theme (e.g., check for updates, contact the developer). Remember to rename your theme folder back to its original name if it wasn’t the issue, or install a new, working theme.

5. Check Your .htaccess File

The .htaccess file is a powerful configuration file used by Apache web servers. Incorrect rules, especially those related to redirects or rewrites, can easily trigger the WordPress login page refreshing loop.

Resetting .htaccess:

  1. Connect to your site via FTP/SFTP or use your hosting control panel’s File Manager.
  2. Look for the .htaccess file in your WordPress root directory. It might be hidden, so ensure your FTP client or file manager is configured to show hidden files.
  3. Download a copy of .htaccess to your computer as a backup.
  4. Once you have a backup, either rename the file to something like .htaccess_old or delete it. Renaming is safer as it preserves the original.

With the .htaccess file disabled, try logging into your WordPress dashboard. If you succeed, then the .htaccess file was the problem. Once logged in, go to Settings > Permalinks in your dashboard and simply click “Save Changes” without making any modifications. This will generate a new, correct .htaccess file for your site. If custom rules were previously added, you will need to re-add them cautiously.

6. Increase PHP Memory Limit

Sometimes, the WordPress login page refreshing loop occurs because your WordPress site is running out of memory. If WordPress doesn’t have enough PHP memory to execute all the processes required for a successful login, it can fail and redirect you back to the login screen.

How to Increase PHP Memory:

  1. Connect to your site via FTP/SFTP or use your hosting control panel’s File Manager.
  2. Locate the wp-config.php file in your WordPress root directory.
  3. Download a copy as a backup.
  4. Open wp-config.php with a text editor.
  5. Add the following line of code just before the line that says /* That's all, stop editing! Happy publishing. */:
    define('WP_MEMORY_LIMIT', '256M');
  6. Save the file and upload it back to your server, overwriting the old one. We recommend 256M, but you can try 128M or 512M if 256M doesn’t work.

Alternatively, you can try editing your php.ini file (if you have access) or your .htaccess file:

  • For php.ini: Add memory_limit = 256M;
  • For .htaccess: Add php_value memory_limit 256M

Try logging in again. If this fixes the WordPress login page refreshing loop, you’ve hit your memory limit. Consider optimizing your site and potentially speaking with your host about increasing default limits if this is a recurring issue.

7. Check File Permissions

Incorrect file permissions can prevent WordPress from reading or writing necessary files, which can manifest as the WordPress login page refreshing loop. WordPress needs specific permissions to function correctly, especially for critical files and directories.

Recommended Permissions:

  • Directories: 755 (drwxr-xr-x)
  • Files: 644 (-rw-r--r--)
  • wp-config.php: 644 or 600 for extra security (but 644 is generally safe).

How to Change File Permissions (via FTP/SFTP):

  1. Connect to your site via FTP/SFTP.
  2. Navigate to your WordPress root directory.
  3. For Directories:
    1. Right-click on a directory (e.g., wp-content, wp-admin, wp-includes).
    2. Select “File permissions…” or “Change permissions…”
    3. Enter 755 in the Numeric value field.
    4. Check the box for “Recurse into subdirectories” and select “Apply to directories only.”
    5. Click “OK.”
  4. For Files:
    1. Right-click on your WordPress root directory.
    2. Select “File permissions…” or “Change permissions…”
    3. Enter 644 in the Numeric value field.
    4. Check the box for “Recurse into subdirectories” and select “Apply to files only.”
    5. Click “OK.”
  5. For wp-config.php:
    1. Find wp-config.php in the root directory.
    2. Right-click it and select “File permissions…”
    3. Enter 644 or 600. Only apply to this file, do not recurse.
    4. Click “OK.”

If you’re using a hosting control panel’s File Manager, the process will be similar. Look for an option to change permissions. After correctly setting permissions, try logging in again to see if the WordPress login page refreshing loop has been resolved.

8. Check for & Fix Database Issues

Occasionally, a corrupted WordPress database can cause various issues, including the WordPress login page refreshing loop. WordPress has a built-in feature to repair and optimize the database.

Enabling & Repairing Database:

  1. Connect to your site via FTP/SFTP or use your hosting control panel’s File Manager.
  2. Locate the wp-config.php file in your WordPress root directory.
  3. Download a copy and open it in a text editor.
  4. Add the following line of code just above the line that says /* That's all, stop editing! Happy publishing. */:
    define('WP_ALLOW_REPAIR', true);
  5. Save and upload the modified wp-config.php file.
  6. Now, open your browser and navigate to https://yourdomain.com/wp-admin/maint/repair.php (replace yourdomain.com with your actual domain).
  7. You will see a screen with options to “Repair Database” or “Repair and Optimize Database.” Choose “Repair Database” first.
  8. After the repair process is complete, try logging into your WordPress admin.
  9. Important: Once you’ve successfully logged in and confirmed the fix, remember to remove the define('WP_ALLOW_REPAIR', true); line from your wp-config.php file. Leaving it there is a security risk as anyone could access that page.

9. Reset User Password via PHPMyAdmin

If you suspect your current password might be corrupted in the database, or you’re simply locked out and want to try a clean slate, you can reset your admin password directly through the database.

How to Reset Password:

  1. Access your hosting control panel (e.g., cPanel, Plesk).
  2. Look for “phpMyAdmin” in the database section.
  3. Once in phpMyAdmin, select your WordPress database from the left sidebar. (If you have multiple databases and aren’t sure which is which, check your wp-config.php file for DB_NAME).
  4. Find the wp_users table (the prefix wp_ might be different, e.g., wp_a123_users). Click on it.
  5. Locate your admin username in the list and click “Edit” next to it.
  6. In the row for user_pass, select “MD5” from the Function dropdown menu.
  7. In the “Value” field for user_pass, delete the existing value and type your new password.
  8. Click the “Go” button to save your changes.

Now, try logging in with your new password. This often bypasses any weird session issues that might be causing the WordPress login page refreshing loop.

10. Contact Your Web Host

If you’ve gone through all the steps above and are still experiencing the WordPress login page refreshing loop, it’s time to contact your web hosting provider. They have access to server-level logs and configurations that you don’t, and they can often pinpoint issues related to:

  • Server-side caching (e.g., Varnish, LiteSpeed Cache) that might be misconfigured.
  • Firewall issues preventing cookie setting.
  • Disk space limitations or other server resource issues.
  • Specific PHP version incompatibilities or error logs.

When you contact them, provide a clear explanation of the problem, the steps you’ve already taken, and any error messages you might have seen. This will help them diagnose the issue more quickly.

💡 Pro Tips

  • Always keep a recent backup of your WordPress site. This login loop is annoying, but it’s even worse if you realize data is missing and you can’t restore it. A good backup strategy is your best defense.
  • Use a strong, unique password for your WordPress admin and FTP/hosting control panel. Avoid common phrases.
  • Never make changes to core WordPress files (inside wp-admin or wp-includes). All fixes should involve wp-config.php, .htaccess, or files within wp-content.
  • Consider using a staging environment for testing new plugins, themes, or major updates. This prevents potential conflicts from affecting your live site.
  • Regularly update your WordPress core, themes, and plugins. Outdated software can lead to vulnerabilities and compatibility issues that could contribute to the WordPress login page refreshing loop.

Frequently Asked Questions

What is the most common reason for the WordPress login page refreshing loop?

The most common reasons are incorrect WordPress Address (URL) and Site Address (URL) settings, followed closely by browser cache and cookie issues, and plugin conflicts. Addressing these three first will often resolve the WordPress login page refreshing loop.

Can a security plugin cause the WordPress login page refreshing loop?

Yes, absolutely. Security plugins often intercept login attempts, modify redirections, or implement strict firewall rules. If misconfigured or incompatible with another plugin or your server setup, a security plugin can easily trigger the WordPress login page refreshing loop. Temporarily disabling all plugins (as described in step 3) is crucial for diagnosis.

How do I fix the WordPress login page refreshing loop without FTP access?

Without FTP access, your options are limited. You could try cleaning your browser cache/cookies (Step 1). If that doesn’t work, you’d typically need access to your hosting control panel’s File Manager (which serves a similar function to FTP) or phpMyAdmin to implement the other fixes for the WordPress login page refreshing loop. If neither is available, contacting your web host is your only recourse.

Will updating WordPress fix my WordPress login page refreshing loop?

Possibly, but it’s not guaranteed. Sometimes, newer WordPress versions include fixes for known issues that might be contributing to the problem. However, if the cause of your WordPress login page refreshing loop is a plugin conflict or incorrect URL, updating might not help and could, in rare cases, exacerbate the issue if new incompatibilities arise. It’s generally best to try the diagnostic steps first.

After fixing the WordPress login page refreshing loop, should I delete the wp-allow-repair line from wp-config.php?

Yes, absolutely! The line define('WP_ALLOW_REPAIR', true); should be removed from your wp-config.php file immediately after you’ve completed any necessary database repairs and regained access to your site. Leaving it in place creates a security vulnerability, as anyone could potentially trigger database repair operations on your site.

Conclusion

Encountering the WordPress login page refreshing loop can be an incredibly frustrating experience, but as you’ve seen, it’s a hurdle that can almost always be overcome with a systematic approach. We’ve walked through the most common causes and provided detailed, step-by-step solutions, from simple browser tweaks to more advanced server-side configurations. By patiently working through these fixes, you should now have full access to your WordPress dashboard once again.

Remember, prevention is always better than cure. By maintaining regular backups, keeping your WordPress core, themes, and plugins updated, and exercising caution when installing new components, you can significantly reduce the likelihood of encountering the WordPress login page refreshing loop or similar issues in the future. Don’t hesitate to bookmark this guide for future reference, should you or another WordPress user ever face this perplexing problem again.

We hope this comprehensive guide has empowered you to resolve your login woes and provided valuable insights into the inner workings of your WordPress site. Get back to creating, managing, and growing your online presence with confidence!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *