Have you ever experienced being stuck in the WordPress login redirect loop? Even when you enter your right credential you still can’t get into your dashboard and you are redirected to the login page. This error can be frustrating.
Based on our experience with similar issues of WordPress, we can say that there are many reasons that cause this error. In this article, we tend to discuss WordPress login redirect loop error and how to fix it.
As always, we recommend you getting a backup of your entire website before following the steps below.
- 1. Delete Browser’s Cache and Cookies
- 2. Restore .htaccess File
- 3. Disable Themes and Plugin
- 4. Update WordPress Permalinks
- 5. Check the wp-config.php File for the WordPress URL
1. Delete Browser’s Cache and Cookies
Cookies are very useful but sometimes they can cause a lot of errors. The cache is another method that browsers use to save a web page in the memory, so the same page loads faster next time you visit it. Because you don’t need to load the page from the webserver.
You may have updated your WordPress password but your browser still uses the old information or your browser’s cache uses an older version of WordPress. Deleting cache and cookies can boost your system’s performance and fix the WordPress login redirect loop. Below we have explained how to delete cache and cookies in famous browsers.
How to Delete Cache and Cookies in Google Chrome
In our previous article, we have explained how to clear cache in Google Chrome. However, we will briefly explain it down below.
After opening Chrome, on the top right corner, you can see three dots. Click on it. Then click on “History” and on the left-hand side click on “Clear browsing data”. A new page opens up, from the drop-down menu select “the beginning of time”.
Also, make sure Cached images and files and Cookies and other site and plugin data are selected. Finally, click on “Clear browsing history”. Now reopen your browser and try to login to your WordPress dashboard again.
If you are using Google Chrome to access your website, this method should fix the redirect loop error.
How to Delete Cache and Cookies in Mozilla Firefox
After opening Firefox, click on three lines on the top right corner. Click on “History”. Then click on “Clear Recent History”.
From the timeline menu select “Everything”. Make sure you select Cache and Cookies and click on “Clear Now”.
How to Delete Cache and Cookies in Safari
Click on “Safari” on the top left corner, right next to the Apple logo. Then, click on “Preferences”.
Select “Privacy” and click on “Manage Website Data”. Now select your WordPress website and click on “Remove”. You can also delete all data by clicking on “Remove All”.
How to Delete Cache and Cookies in Microsoft Edge
Open Edge, click on three dots on the top right corner and click on Settings. From the settings page, go to “Clear browsing data”.
Then click on “Choose what to clear” and from the opened menu select Cached data and files and Cookies and saved website data. Now click on “Clear”. Once you see “All Clear!” message all of your cache and cookies are deleted.
2. Restore .htaccess File
The .htaccess file contains WordPress rewrite rules related to your website and the related link which helps your website to work properly.
Although, this file may break or gets edited by a plugin. Therefore, these codes won’t work properly and you face a WordPress login redirect loop error.
In this case, you need to delete the previous file and replace it with a newer version. To delete the current version, you need an FTP client like FileZilla to enter your website.
If you are using FileZilla, you can simply right-click on the .htaccess file and delete it. Otherwise, by renaming the file to .htaccess_old you can backup it. Sometimes, there is also another .htaccess file in WordPress directory which needs to be deleted as well.
Now try to login to your WordPress dashboard again. If you are successful, it means your .htaccess file was preventing you from entering your dashboard. Once you are logged in, head over to settings and from permalinks click save to create another .htaccess file.
3. Disable Themes and Plugin
WordPress login redirect loop error is often caused by plugins. For example, a recently installed plugin is not compatible with your version of WordPress or your website’s codes and causes issues.
To disable your plugins, use FTP to enter your website and rename your “Plugins” folder to plugins.old or any other name you prefer. You need to make sure WordPress isn’t identifying that folder. This way all of your plugins are disabled.
Now try to login to your WordPress dashboard. If you are successful, a plugin is causing the error. Now to enable your plugins, rename your folder back to “Plugins”. Now you need to rename your plugins one by one until you find the one that’s causing the error.
Other than plugins, installing or updating customized themes can cause this error. To find the issue, first, you need to change your theme back to the default theme via FTP.
Like plugins, you need to rename the “Themes” folder, if the redirect loop error is fixed then your theme is causing the error.
You can also use phpMyAdmin to go back to the default theme. To do so, head over to your cPanel and from the database section click on phpMyAdmin.
Find the database connected to your WordPress website. Open it and select wp_options. Now the right table is opened, by clicking on “Browse” and click on “Show All” you can see every single column. Here you need to look for “Template” and “Stylesheet”. From both tables change your theme’s name to “twentyseventeen” which is the default theme. Save it and try to login to WordPress again.
If you are using the default theme, you can change its name and try logging in again. If you are successful, it means your default theme is causing the error. You need to download the newer version of the default theme from WordPress theme store and install it on your website.
4. Update WordPress Permalinks
The site URL option is where you identify the address everyone uses to enter your website. This option manages your website’s URL. If it’s not configured correctly, it can cause WordPress login redirect loop error.
To fix it, connect to your database. Then enter your website’s URL with or without https in “siteurl”, “home” and “wp-options” tables. Now try to login to your WordPress website.
5. Check the wp-config.php File for the WordPress URL
If the method above didn’t work properly for you, you can use this method to fix your URL problem. With FTP enter your website and locate and open the wp-config.php file. Add the codes below to your file and make sure you change “example.com” to your actual URL. Also, if your website uses “www.” Make sure you add it as well.
Save your changes and try to login to your WordPress dashboard.