Being stuck in the WordPress login redirect loop can be frustrating. This is one of the more popular problems with the WordPress login screen, where you keep getting redirected back to the wp-admin view, even though you sign-in using the correct credentials each time. Fortunately, there are a few ways to address this issue.
In this tutorial, we will show you how to fix the WordPress login redirect looping error. As always, we advise you to create a back-up of your WordPress site; if you don’t know how to backup your site, read this tutorial. When your site is backed-up, we can move ahead with solving this error once and for all.
What you’ll need
Before starting this tutorial you’ll need the following:
- Access to your hosting account
Table of Contents
Option 1 – Clearing Browser Cookies and Cache
Like many other web technologies, WordPress utilizes cookies for user authentication and session management. And just as cookies can be useful, they can also be an obstacle in some unique instances. Caching is another such mechanism; web browsers store web pages in their cached memory so that the pages would load quicker next time as they don’t have to be fetched from the server. Clearing cookies and cache of your web browser can not only improve performance but also fix the WordPress login redirect loop issue. Instructions on how to empty your cookies and cache in popular web browsers are given as follows:
1.1 Google Chrome
Upon opening Chrome, you will see a three-dotted button on the top-right corner of the screen. Clicking it will reveal a drop-down menu. Choose History from this menu, and go to Clear browsing data situated on the left of the screen. You should be able to see a dialog box. Here, select Cookies and other site and plugin data as well as Cached images and files. Choose the beginning of time option in the drop-down menu, and click the Clear browsing history button.
1.2 Mozilla Firefox
In Firefox, you can clear cookies by clicking on the button with the three bars on the top-right of the screen. From the menu, select History. Next, choose the Clear Recent History option. Now set Everything as date range, check Cookies and Cache and click on Clear Now.
The more detailed tutorial showing how to clear cache on FireFox can be found here.
Click the Safari button on the top-left corner of the screen, located right next to the Apple logo. From here, select Preferences. Next, choose the Privacy option, which will take you to the privacy settings screen. Click the Manage Website Data… button. Now find your WordPress site in the list and click on Remove. Alternatively, you can hit Remove All button to clear all data.
1.4 Microsoft Edge
Open up Edge, and click the horizontal three-dotted button on the top-right. Choose Settings from the drop-down menu. You then will be taken to the settings page, where you need to find the Clear browsing data section. Once you’ve located this area, click on Choose what to clear. From the subsequent menu, check Cookies and saved website data and Cached data and files. Then, click Clear. You should see the All clear! message, confirming that your cookies and cache data has been erased.
Option 2 – Restore Default .htaccess file
In some cases, the otherwise benevolent .htaccess file may be the culprit behind the WordPress login redirect loop. Your wp-admin not working could be a direct result of a corrupted .htaccess file, which means that you should remove this faulty version of the file, and replace it with a working one.
To remove your existing .htaccess file, open up an FTP client like FileZilla and connect to your site. The .htaccess file can be found in the site’s root folder (usually it’s public_html). If you using FileZilla simply right-click on .htaccess file and choose Delete. Alternatively, you can disable this file by renaming it to, for example, .htacccess-disabled.
Once deleted, follow this tutorial on how to create a default .htaccess file for your WordPress site.
Option 3 – Deactivating Themes and Plugins
Another suspect area to explore if your WordPress login is not working pertains to your site’s themes and plugins. There have been cases where some plugins behave strangely with other plugins already installed. To make sure that a bad plugin isn’t causing the WordPress admin area redirect loop, simply connect to your account using FileZilla, and enter the wp-content directory. Rename the plugins folder to something else, which will ensure that WordPress does not find them when loading your site. Now, check to see if the login redirect issue still persists. If not, it means there was a problem with your plugins.
If WordPress login redirect loop issue is gone, it means one or more plugins were corrupted. To find out which plugin is corrupted, enable plugins by the renaming folder back to plugins and try to disable individual plugins. You can do this by renaming each plugin folder one by one.
In addition to plugins, custom themes can also cause WordPress login to not work. To troubleshoot this instance, revert your site to the default WordPress theme. You can do this using phpMyAdmin.
To revert to the default WordPress theme on Hostinger WordPress hosting, access your control panel and go to Databases. Choose appropriate MySQL database (see this tutorial on how to find out WordPress database name) and click on phpMyAdmin, and from there, select the relevant database.
Next, expand database tables and choose wp_options (you may have a different prefix than wp_). Now that the table is open, select Browse and click on Show All. This will let you see every column of the table.
From here, you have to find the template and stylesheet rows. For both rows, follow this procedure – double-click on the current theme name and change it to twentyseventeen (default WordPress theme).
Now, try to login to wp-admin. If you’re not getting the redirect loop, then it means that your custom theme was causing the error.
Experiencing the WordPress login redirect loop can be frustrating, especially for someone new to the web development. In this tutorial, we learned how to fix this irritating error by discussing the following methods:
- Clearing browser cookies/cache
- Restoring default .htaccess file
- Deactivating themes/plugins
Hopefully, you’re able to fix this error using any one of the above options. Check out similar WordPress tutorials where we resolve various bugs and errors.