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. WordPress Login Redirect Loop occurs when you are redirected continually to the wp-admin page even when you have the correct login details.

It’s scary but really easy to fix. We’ll explain 5 proven ways of solving this problem. These methods include:

  1. Clearing Your Browser Cache
  2. Manually Deactivating Plugins
  3. Reverting Back To Default WordPress Theme
  4. Renaming Or Deleting htaccess File
  5. Editing wp-config.php File.

To go straight to the solution part, click any of the methods above.

 

The Problem

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

You have entered the right information, but the page keeps refreshing and redirecting you to the same location. So, what’s the problem?

Can't login to WordPress dashboard

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.

WordPress Login Redirect Loop – The Causes

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 the WordPress theme? Is the WordPress redirect loop a result of a faulty 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 redirection loop

WordPress Login Redirect Loop – The Solutions

Before you start, create a backup, this is important If you accidentally overwrite certain files, you can’t bring them back! WordPress plugins will make the process easier, so have that in mind.

Now, it’s time to set this login page refreshing matter straight once and for all.

1. Clear Your Browser Cache

WordPress sites use cookies to collect data during WP-admin/customer login events. These cookies can sometimes interfere with login processes and create redirects loop error or similar internal server errors.

All you have to do in this case is to clear browsing data.

  1. In the top right corner, press on the 3 dots button. Then, follow the path from the image below.
    Wordpress refreshing and redirecting issues

  2. On the left side, you will see a “Clear browsing data” button, press it.Clear browsing data

  3. Lastly, set a time range to “All time“, check the “Cookies and other site data” option, and click “Clear data
    Clean all browsing data

 

2. Manually Deactivate Plugins

Sometimes a plugin or multiple plugins for WordPress can have corrupted codes. Since you can’t access your dashboard, you will have to disable your plugins manually.

  1. Firstly, open your FTP Client (FileZilla is a great and free one).
  2. Enter the web host’s name, your username/password, and the port from which you will access the FTP client. *If you don’t know all that information you can ask your hosting provider.
    Fix the issue

  3. Open the wp-content folder.
  4. Locate the “Plugins” folder and rename it to something like “Plugins Backup”.
    Wordpress login redirect loop

  5. Don’t close FileZilla yet, we may need it soon.
  6. Go back to your browser and refresh your WordPress website.

This should fix the WordPress login problem. If not, move to the next step.

3. Revert Back To Default WordPress Theme

Just like with plugins, something can go wrong with the theme itself. There could be a virus or something that is interfering with the code. Maybe the developers did not update the theme, so it is no longer compatible with the new version of WordPress.

As a result, you are experiencing WordPress redirect loop, thereby unable to login to wp-admin. What now?

Just as we did in the second solution, this fix revolves around renaming WordPress files too. The only difference is that you need to rename “Themes” instead of the “Plugins” folder.

WordPress wp-admin redirecting

Now, here is the catch, the renaming method only works when a current theme is not one of the default themes. But, what should you do if it is?

My Theme Is Already A Default WordPress Theme?!

Fear not, the only difference here is that you also need to overwrite some files.

  1. Go to the official WordPress site.
  2. Download the latest WordPress files.
  3. Then, open FileZilla if you did not leave it open.
  4. Unzip the WordPress files, and drag the “Themes” folder to the wp-content folder.
  5. Accept the overwrite, and now you have a fresh copy of the themes on your site.
  6. Go back to your browser and refresh it.

All in all, the WordPress wp-admin redirect loop should now stop.

4. Rename Or Delete htaccess File

The htaccess file contains a set of rules on how the internal server should respond to various requests. There are times when this relation gets altered and as a result creates a redirect loop on wp-admin. The fix is rather simple:

  1. Switch back to File Zilla.
  2. In the main directory, you will see the file named “.htaccess“.
  3. Delete it, or just rename it to have a backup.
  4. Refresh your browser.
  5. If you now have the WordPress wp-admin access, go to Settings/Permalinks.
  6. Scroll down to the bottom and press Save Changes.
  7. That’s it, you should no longer have any wp-admin redirect or similar server errors.

Note: The deleted htaccess file (or in our case renamed) is a very common fix. It can be a great trick for any website builder/developer.

5. Edit wp-config.php File

wp-config.php file is one of the more important files of the WordPress package. It contains information WordPress needs to connect to the database. Surely, it is not something you should mess around with for the fun of it.

In a case that you accidentally change something (e.g. Database Name) and you are using a WordPress hosting service, you can ask your provider for the information, and change it back.

Now, if all the steps above did not work, you can try the update site URL method.

To do that simply go to Filezilla, and open the wp-config.php file.

Before “/* That’s all, stop editing! Happy publishing. */” line, add the following:

Fix WordPress login

*With yoursite.com part being the actual URL of your website.

And there you go, you’ve defined your Site URL and WordPress admin login redirect issue is now fixed.

Bonus Tip Of The Day: If you are in urgent developing trouble and need help with it, sites like Stack Overflow or Stack Exchange can surely help. They can assist you with problems related to meta (Meta Stack Exchange), WordPress security, refreshing and redirecting issues, and much more!

Note that these “forums” use the English language only.

WordPress Login Redirect Loop – Conclusion

Now you know what to do when the WordPress login page refreshing error occurs. If we managed to help you with this question or you would like to improve this answer, write a comment below. 

To see more WordPress tutorials or WordPress related posts check the rest of our blog.

More Resources: