Now Reading
How To Fix WordPress Login Redirect Loop Problem

How To Fix WordPress Login Redirect Loop Problem

This is one of those things all WordPress developers stumble upon at some point in time. In this rather short step by step WordPress troubleshooting  guide, we will talk about what causes this error and how to fix WordPress Login Redirect Loop issue.

I understand being stuck in the WordPress login page can be frustrating. Fortunately, there are several ways to solve this issue. Take a look at this article as we’ll uncover how to solve WordPress login redirect loop issue using three simple methods.

Four Ways to Fix WordPress Login Redirect Loop Issue

  • Method 1: Check your URL settings.
  • Method 2: Clearing Browser Cookies and Cache
  • Method 3: Restoring Default .htaccess file
  • Method 4: Deactivating Themes and Plugins

Also Read : Simple fix for Facebook login redirect loop problem.

The Problem :

“I am trying to login to my WordPress dashboard but something is wrong?!?”

You enter the right information, but the page keeps refreshing and redirecting you to the same location. So, what’s the idea here?. If you were redirected to the same place, it all boils down to the same thing. What you are dealing with is the so-called WordPress login redirect loop. Let’s put our computational science caps and fix the issue.

 

The Causes & Fix

To find what’s causing the issue, we must first check a couple of things. Is it a faulty plugin? A wp-admin directory problem? An error in WordPress theme? Is something wrong with wp-admin or wp-login.php files? All these things can both create login issues and make you unable to login to your admin panel.

WordPress login redirect loop issue occurs when the platform keeps redirecting you to the wp-admin page even though you input the correct login credentials.

Depending on its cause, there are four ways to solve the WordPress login redirect loop issue: clearing browser cookies and cache, restoring .htaccess file, and deactivating themes and plugins.

Be sure to back up your WordPress site first before making any major changes to avoid data loss

Method 1: Check Your URL Settings

One of the most common misconfigurations that causes a redirect loop is that your WordPress Address and Site Address differ from the permalinks you configured with your hosting provider. The difference could be as small as one address having the www prefix and the other not.

For example, let’s say you registered your domain with your hosting provider as http://www.example.com then you set your WordPress Address and Site Address as http://example.com. While this doesn’t seem like a big deal, it actually causes a redirect loop.

If a user types in http://example.com, they will be redirected to http://www.example.com, then redirected back to http://example.com by WordPress. This may prompt an error message.

The good news about this misconfiguration? It’s an easy fix. Just edit your WordPress Address and Site Address in the General Settings section so they match how you configured your site with your hosting provider.


Method 2: Clearing Browser Cookies and Cache

WordPress uses cookies for user authentication and session management. It also enables caching to make your site loads faster.

While they are beneficial to your site, cookies and cache can cause the WordPress login redirect loop issue. The problem arises when your browser’s cookies and cache still hold onto old information or use outdated WordPress files.

Checkout our detailed article on how to clear your browser cookies and cache in popular web browsers:

Google Chrome

  1. Click the three-dot menu at the top-right corner, then select History. Alternatively, you can press Ctrl+H.
  2. Choose Clear browsing data from the left column.
  3. Once the dialog box appears, tick the Cookies and other site data and Cached images and files options. Set the time range to All time, then click Clear data.

 

Mozilla Firefox

  1. Select the hamburger button at the top right corner, then got to Options -> Privacy & Security.
  2. Navigate to the Cookies and Site Data section and select Clear data.
  3. Tick the Cookies and Site Data and Cached Web Content options, then click Clear.

See Also

Safari

  1. Navigate to Preferences -> Privacy. Alternatively, you can press Command+.
  2. Select Remove All Website Data button, then click Remove Now.

Microsoft Edge

  1. Click the three-dot menu at the top right corner, then select History. You can also press Ctrl + H.
  2. Select the Clear history link to open the Clear Browsing Data menu.
  3. Tick the Cookies and saved website data and Cached data and files options, then click Clear.


Method 3: Restoring Default .htaccess file

If you made custom changes to the hypertext access file, or the .htaccess file, it may be causing a redirect loop. In that case, you’ll have to rename the file and create a new one. To do so, go to File Manager and select your .htaccess file. Then right-click to rename it .htaccess_old. This is now your backup file.

Now, go to public_html in File Manager. Create a new text file and name it .htaccess. Copy and paste the following code into the file.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Method 4: Deactivating Themes and Plugins

Conflicting or corrupted plugins is another common culprit of the WordPress login redirect loop issue. Therefore, you need to deactivate the faulty plugin.

Here’s how to troubleshoot the login redirect loop issue by deactivating your WordPress plugins:

  1. Access your website’s wp-content directory using an FTP or a File Manager.
  2. Rename the plugins folder to something else to deactivate all plugins. If this action solves the issue, that means you have a corrupted plugin. What we need to do now is to find the exact culprit.
  3. Change the plugins folder to its original name. This way, WordPress can re-access your plugins, but all of them are still inactive.
  4. Login to your WordPress dashboard and head over to Plugins -> Installed Plugins. Activate all plugins.
  5. Logout from WordPress, and go back to your File Manager.
  6. Open the plugins directory, and disable the plugins one by one by renaming the corresponding folders. Each time you disable a plugin, try to login to your site and keep doing that until you find the one that causes the issue.

Similarly, a faulty custom theme can also disrupt your access to wp-admin. To confirm this suspicion, you need to revert the site to the default WordPress theme — twentyseventeen.

Here’s how to troubleshoot the login redirect loop issue by deactivating your WordPress theme:

  1. Access your site’s MySQL database via phpMyAdmin. If you’re a Hostinger user, open your hPanel, go to phpMyAdmin and select your database. If you don’t know your WordPress’ database name, this tutorial can help you.
  2. Click Browse next to the wp_options table. Please note that the table’s prefix may vary.
  3. Expand your table’s content by checking the Show all option.
  4. Locate the template and stylesheet rows, then rename the values to twentyseventeen by double-clicking the current theme name.
  5. If you can log into your site, that means your current theme causes the login redirect loop error.

Conclusion

WordPress login redirect loop is a common issue that can happen to anyone. Fortunately, you can easily solve this error by clearing browser cookies and cache, restoring default .htaccess file, and deactivating themes and plugins.

Do you find this tutorial helpful? Let us know in the comments section below!

© 2020 GREWAL INC. ALL RIGHTS RESERVED.