Sometimes WordPress starts to refresh and redirect user/admin from the WP login page, even if user name and password entered are correct, back to the login screen. In this article you will learn how to fix WordPress admin login page refreshing and redirecting issue.
It is important to note, that this solution is only for the above mentioned situation, and only for self hosted WordPress installations. This solution is not for WordPress.org hosted sites. Other login issues includes for example login problems caused by error establishing database connection, internal server error or white screen of death. Solutions on this page does not work on those problems.
The WP login page redirecting back to the login page problem can occur in many situations. We have faced it for example on the following situations:
- The entire site was copied from another domain to the new domain. (for example from .com to .net etc.)
- New plugin or theme was installed.
- The site was moved to the new web host.
- Just out of the blue, without any clear reason (these are most likely cookie or .htaccess related problems).
Cleaning cookies and cache is the first thing you should try. It is also the most common cause for the WP login page redirect problem, and it is also the easiest to fix.
Another cookies related solutions for the problem is to make sure that you have cookies enabled. WordPress login will not work if you do not have those allowed. This could be the case especially if you are trying to login using some other device than the computer you are normally using. So, make sure that cookies are on.
Please note, that you should restart the browser and/or computer after cleaning cookies.
Deactivate all WP plugins / other new scripts
If you have just installed some new plugin, that is the most common cause for the login problem. There could be conflict between two or more plugins. Just disable the plugin, and you should be able to login.
Plugins can be the reason even if you do not have added any new ones recently. That is because maybe you have updated some plugins or some plugins could have been automatically updated without admins knowledge. New version(s) could cause conflict. In these cases you can try enable login again by disabling all the plugins.
How to disable all plugins if WP admin login does not work?
You should use FTP client such as WinSCP or file manager through cPanel. Navigate to the root directory and /wp-content/plugins/ Now you can rename each sub directory. You can just add for example 0_ for each directory name, and go those through one by one. You can try to login after each rename, and test if the plugin you have just renamed is the cause of conflict.
You can also rename the whole plugins directory for example to 0_plugins, and test if you are now able to login.
If you have installed some other scripts on the same domain, you should also try disabling those, if disabling all the plugins does not help.
Delete the .htaccess file(s)
In some cases the .htaccess file causes problems. It could be because of some plugin you have just installed have modified the .htaccess file or you might have switched on some features that have done modifications on the file. The .htaccess file could also get corrupted, causing login problems.
You should use FTP client such as WinSCP or file manager through cPanel. Navigate to the root directory and delete the .htaccess file. Check out if there is another located in the admin directory. Delete it also. However, before deleting those, make sure you have backups of those. You can get backup just by downloading the file using FTP client.
If you can not find the .htaccess file, make sure that you have at FTP client settings “show hidden files” enabled. These so called “dot files” are in most cases hidden if using default settings.
Try login, if it works, you found the problem. Now you can create the new .htaccess file just navigating at the WP admin to Settings » Permalinks and clicking save. It updates the permalink structure and creates the new .htaccess file.
Define the site URL at WP-config file to fix the WP login redirect
In some cases updating / defining the site URL at wp-config.php file helps. You should use FTP client such as WinSCP or file manager through cPanel. Navigate to the root directory and open the wp-config.php file in editor. Then find the line:
/* That's all, stop editing! Happy blogging. */