Are you or your users being redirected back to the login screen after logging in? In some cases, users experience a WordPress login redirect loop which prevents them from accessing the admin panel. As a result, no one can create content or manage a website.
In today’s tutorial, I’ll go over a few things you can check to solve the login redirect and refresh problem in WordPress. Because there are so many things that can cause this issue, it’s hard to pinpoint exactly what your specific problem is.
Let me help you do a bit of troubleshooting.
Clearing Browser Data
Sometimes, browsers are at fault by saving too much outdated or corrupted data. In reality, clearing the cache in the browser solves a lot of online problems when it comes to experiencing a website issue.
Start by clearing the cache and cookies of your web browser. Restart the program and try to log into your website again.
This will remove any bad or obsolete data your computer is trying to load when visiting the site. Essentially, it tells your browser to download the information again.
This is perhaps the easiest place to start, and it only requires a minute or two.
Deactivate Your Plugins
In some cases, installed plugins have been known to corrupt a website. This is often due to outdated or poor programming from the developer. It’s also one of the reasons why I suggest only using plugins that are regularly maintained.
An older plugin may have problems when it comes to new updates in WordPress.
To deactivate your plugins, you’ll need to access your website’s root folder. You can do this easily by using FTP software like FileZilla. However, I’m going to use cPanel’s File Manager to save some time.
From the root directory of your site, access the “wp-content” folder. You can do this in File Manager by double-clicking it.
Rename the “plugins” folder to “plugins_backup.”
This will disable all of the plugins in your website and give you access. That is, if it’s a plugin that is causing the login redirect problem in WordPress.
If you still have the redirect issue, then you know it’s not a plugin causing the problem. You can then rename “plugins_backup” to “plugins.”
If you’re able to log into your site after renaming the plugin folder, you’ll have to troubleshoot plugins even further. The best way to find the problematic plugin is to create a new “plugins” folder in your web host directory and add the plugins one-by-one while testing in between each.
As soon as you’re unable to access the site, you’ll know which plugin is causing the problem.
Deactivating the Theme
Plugins are not the only tools that can stop WordPress from responding correctly. Themes also need consideration. An outdated or improperly developed theme has potential to cause WordPress to redirect after a login attempt.
By deactivating your current theme, WordPress will automatically revert back to its default. This may give you a chance to log into your site and make further corrections.
To access the directory, click into the “themes” folder. It’s located in the same place as your plugins from the solution above.
Rename the current theme to something you’ll recognize. I suggest using the same tactic as the plugin and add a “_backup” at the end of the name.
If the theme is the problem, this will give you access to your site. At which point, you’ll know the theme needs updates or further repairs.
Check .htaccess File
The .htaccess file has potential to cause some of the most common WordPress errors including not being able to log in. Deleting this file is a viable option for being able to access your admin panel.
By default, the .htaccess is hidden. You’ll need to “unhide” files before you can access it. Go into the Settings of cPanel and check the “Show Hidden Files” option. After you click save, .htaccess will become visible.
Your preferred FTP program should have a similar setting.
Now, let’s get rid of the .htaccess. From the website’s directory, find and delete the “.htaccess” file.
Alternatively, you can rename this file as in the examples above. This is helpful if you have custom entries within it. If you still can’t log into your site, then you can rename the file back to .htaccess and keep your custom coding.
If you’re able to log into your site now, you can rebuild the .htaccess file directly from WordPress.
To create a new .htaccess file, go to the Permalinks area in the Settings of WordPress and click, “Save Changes.” WordPress will then construct a new and basic .htaccess file. At which point, you can place your custom additions one-by-one to make sure the redirect loop isn’t caused by something you added.
Changing the Site’s URL in WordPress
Defining the URL often fixes the problem when the WordPress admin login is not working. This can be from an improper settings change by a plugin, theme or an incorrect method when adding an SSL to your website.
If this is the case, you’ll need to edit the URL in the wp-config.php file.
To make changes, edit the “wp-config.php” file in your WordPress site directory.
Add this coding to the wp-config.php file:
Make sure you change the “yoursite.com” portion to your own URL. Also, include the “www” in the domain name if your site uses it. This is often determined when first setting up your web hosting account.
Once you click the save button, your site will have the most valid data for the URL. You may have access to your admin panel.
Get Your Site Back
If all else fails, you can always restore from a backup copy of your website. Of course, you might lose any current data if you don’t perform these backups regularly. A WordPress login redirect problem is only one of many reasons why I suggest you always perform backups. It’ll make getting your site back much easier.
What kind of errors have you come across in WordPress? How often are your plugins and themes updated?
Author: Josh Dargie
My name is Josh Dargie and I’m the Operations Manager at GreenGeeks. I’ve been with the company since 2009. I have over 16 years of experience working with and for various web hosting providers specifically in development, day-to-day operations and customer service.