We often get messages from our users that their WordPress login page keeps refreshing and redirecting. This locks them out of the WordPress admin area, and they are unable to work on their website.
Login issues can be caused by various different errors such as error establishing database connection, internal server error or white screen of death.
Another type of login error is when your WordPress login page keeps refreshing and redirecting it back to the login screen. In this article, we will show you how to fix the WordPress login page refreshing and redirecting issue.
If you are going to try the advanced steps mentioned in this WordPress tutorial, then please create a back up of your site. See our guide on how to manually create WordPress database backup.
Video Tutorial
If you don’t like the video or prefer the written version instead, then please continue reading.
What Causes Login Page Refresh and Redirect Issue in WordPress?
Incorrect WordPress URL settings and failure to set login cookies are the most common reasons causing the login page redirect and refresh issue.
Normally, when you login, WordPress validates your username and password and then sets a login cookie in your browser. After that, it redirects you to the WordPress admin area.
If WordPress fails to set the login cookie correctly, or your WordPress admin area URL is incorrect, then you’ll be redirected back to the login page instead of the admin dashboard.
That being said, let’s troubleshoot and fix the WordPress login page redirect and refresh issue.
Clear Cookies to Resolve Login Issues
WordPress uses cookies for login authentication, so the first step in troubleshooting WordPress login issues is the simplest one. Clear your browser cookies and cache.
In Google Chrome, click on the browser settings menu and then select More Tools » Clear Browsing Data.
This will launch the Chrome Settings page with ‘Clear Browsing Data’ popup displayed on the screen.
From here, you need to select ‘Clear cookies and other site data’ and ‘Cached images and files’ options.
Next, click on the ‘Clear data’ button and Google Chrome will clear the browser cache.
Also, make sure that your browser has cookies enabled. After doing that restart your browser and then try to login. This should fix the issue for most folks.
We have a complete guide with screenshots showing how to clear cache and cookies in all major browsers.
Update WordPress URL Settings
WordPress comes with a settings option that has the URL of your website and the URL of your WordPress installation.
If you had access to your WordPress admin area, then you could see this option under Settings » General page.
If these URLs are incorrect, then WordPress will redirect you back to the login page.
Now, since you are unable to access the WordPress admin area, you’ll need to edit the wp-config.php file to fix this issue.
The wp-config.php file is a special file in WordPress which contains your important WordPress settings. You can access using an FTP client or via File Manager app in your WordPress hosting account dashboard.
You’ll find the wp-config.php file in your site’s root folder. Simply edit the file and paste the following code just before the line that says ‘That’s all, stop editing! Happy publishing’.
define('WP_HOME','https://www.example.com'); define('WP_SITEURL','https://www.example.com');
Don’t forget to replace example.com with your own domain name.
After that save your changes and upload the file back to your website.
You can now visit your website and try to log in and hopefully, this would have fixed the issue for you.
If it didn’t, then continue reading for additional steps.
Delete .htaccess File in WordPress
Sometimes .htaccess file can get corrupted which can result in internal server errors or login page refreshing error.
Simply access your website through an FTP client or via the File Manager app in your hosting account dashboard.
Once connected, locate the .htaccess file in the root folder of your website and download it to your computer as backup.
After that, go ahead and delete the .htaccess file from your website.
Next, open the wp-admin directory and if there is a .htaccess file there, then go ahead and delete it as well.
You can now try to log in to your WordPress website. If you succeed, then this means that your .htaccess file was stopping you from logging into WordPress.
Once you are logged in, simply go to Settings » Permalinks page in WordPress admin area and click on the Save button without making any changes. This will generate a new .htaccess file for your website.
Deactivate All WordPress Plugins
Sometimes WordPress plugins can cause this issue especially if there is a conflict between two plugins.
To deactivate all your WordPress plugins, connect to your website using an FTP client or via the File Manager app in your hosting account dashboard.
Once connected, go to the /wp-content/ directory. Inside it, you’ll see a folder named ‘plugins’. This is where WordPress installs all your plugins.
Simply rename the plugins folder to plugins_backup. This will deactivate all WordPress plugins installed on your website.
We also have a detailed tutorial on how to deactivate all WordPress plugins when unable to access WP-Admin.
Once you have deactivated all plugins, try to logging in to your WordPress site. If you succeed, then this means that one of your plugins was causing the issue.
Revert Back to the Default Theme
WordPress themes can also cause conflicts after upgrading to a newer version of WordPress or the theme itself. To find out whether the problem is being caused by your theme, you need to deactivate your theme.
The process is similar to deactivating the plugins. Connect to your website using an FTP client. Go to /wp-content/themes/ directory and rename your current theme directory to themes_backup.
Once you have done that, then try logging in again. If you succeed, then this means your theme was causing the issue.
You can now reinstall a fresh copy of your theme to see if this resolves the issue. If the issue reappears, then contact your theme’s support or switch to a different WordPress theme.
We hope this article helped you resolve the WordPress login page refreshing and redirecting issues. You may also want to see our WordPress troubleshooting guide with step by step instructions on how to fix WordPress errors on your own.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Tobias says
No luck none of them worked
WPBeginner Support says
If none of the methods from this article are working for you, we would recommend reaching out to your hosting provider for them to check if there are any errors on their end.
Admin
Salah says
Thanks a lot,
You saved my day,
I have changed the file wp-config.php as described in the tutorial and that worked for me.
My best regards.
WPBeginner Support says
Glad to hear our guide was helpful!
Admin
Robert clancy says
I messed around with the Update WordPress URL Settings
and that was a world of pain to correct as it took my whole site down. I had to correct it through changing the config settings using FTP.
WPBeginner Support says
The settings are definitely powerful and can cause issues if you change them incorrectly. Glad you were able to fix the issue using FTP!
Admin
DK John says
Your first method worked for me. Thank you for this magical guide
WPBeginner Support says
Glad our guide was helpful!
Admin
David Kuteesa says
Tried all and none worked. Here is what worked:
Went to wp-config.php and set define( ‘WP_DEBUG’, false); to define( ‘WP_DEBUG’, true );
Tried logging in again and got “usermeta table missing” error.
Thats when I realised I had a missing table. Got it from another installation and changed the table prefix to meet current db.
Worked immediately
WPBeginner Support says
Thank you for sharing this, for most beginners we recommend reaching out to their hosting provider if our recommendations do not work as they can check for less beginner friendly errors.
Admin
Stian says
Thank you – that tip about restoring the admin page by adding two lines of code in the config file seems to work nicely (still crossing fingers), but I have hope now, which I didn´t earlier.
WPBeginner Support says
We hope it helps!
Admin
WPBeginner Support says
Glad our guide could help and if you hadn’t set up SSL before changing to https that would definitely be the most likely cause.
Admin
branhampaul says
Thank You, it worked.
I initially had the siteurl & wp address url changed to “https”, and this made me unable to log-in my dashboard. Maybe because I had not ssl at my host set-up.
Re-changing the “https” to “http” helped me log-in back.
Bryan Veloso says
Everything didn’t work. But after downgrading my PHP from 7.4 to 7.2, I was able to login.
Kinda weird, now I’m using an older PHP version.
Did you encounter an issue similar to mine? I want to use the newer PHP version, but it doesn’t let me login in wp-admin.
WPBeginner Support says
More than likely, you may have a plugin causing a conflict, you would want to start by following our troubleshooting guide below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Admin
Alisha says
This issue has never happened to me before, but the 2nd / plugin option worked for me right away.
This website is a lifesaver! Thank you so much!
WPBeginner Support says
Glad our guide was helpful
Admin
Øivind says
Thank you! The wp-config.php-metod worked for me!
WPBeginner Support says
Glad our recommendation was able to assist
Admin
Ruta says
I tried some of these steps, but the problem turned out to be elsewhere: my site was setup as a ‘multisite’ but in wp-config file it said ‘subdomain_install’ as ‘false’, when I changed it to ‘true’, I could login to the site normally without redirects
WPBeginner Support says
Glad you found the solution to the issue
Admin
Jerry says
This was also my problem! I tried all the steps mentioned in the article, but after changing the ‘subdomain_install’ from false to true in the wp-config.php file it worked!!
Thanks!!
Joe says
I have been trying to solve this for MONTHS… Thanks to your comment, I was able to fix it in about 10 seconds. Thank you so much for sharing!
This should be included in the tutorial.
Brayton Scott says
Awesome, and simply tutorial. 1st suggestion fixed my site.
WPBeginner Support says
Glad our recommendation could help
Admin
Fraser says
I followed the instructions to deactivate all plugins and I now have access to wp-admin again! The instructions were easy to follow, and thanks so much for putting them out there.
WPBeginner Support says
Glad our article was helpful
Admin
Sachin Baikar says
Thanks for this great help. The plugin folder renaming worked for me. There was an issue with one of the plugins. Thanks once again
WPBeginner Support says
Glad our recommendations were able to help
Admin
E says
Thank you for this article. It is a complete lifesaver.
WPBeginner Support says
Glad our guide was helpful
Admin
Philipp says
I was looking for a solution for over 5 hours now – nothing worked. But deleting the htaccess file in the wp-admin directory helped!
I cant thank you enough.
Made my day.
WPBeginner Support says
Glad our recommendation helped
Admin
María González says
Thank you! You just saved my life (at least my job!) and a loooot of time (:
WPBeginner Support says
Glad our guide was able to help
Admin
Suraj Handa says
Hey but now its showing that cookies are disable in your browser please enable cookies. What can I do now?
WPBeginner Support says
There are a few possible reasons for a starting point, you may want to clear your cookies and cache to be safe. For a starting point, you may want to take a look at our article below:
https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress
Admin
charlie says
just refresh the page, the wordpress app reacts like that because it suddenly sees no more cookies
ajay mali says
you are always post great content that really helps a lot to everyone. thank you so much.
WPBeginner Support says
You’re welcome
Admin
David Cuff says
Very helpful. Thank you!
WPBeginner Support says
You’re welcome
Admin
ibrahim zouadi says
Thank you for sharing those tips, unfortunately none of them have worked for me. I even uninstalled the whole wordpress plugin. I don’t know what should i do next
WPBeginner Support says
For the next step, you would want to take at our article below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Admin
Anthony says
This helped like charm
Many thanks.
WPBeginner Support says
You’re welcome
Admin
PDN Social says
This was a lifesaver! We were able to follow step-by-step and avoid a major problem!
Great information!
WPBeginner Support says
Glad our guide was helpful
Admin
Jasmeet Singh says
I couldn’t find my wp admin page. It shows
“There has been a critical error on your website. Please check your site admin email inbox for instructions.
Learn more about debugging in WordPress.”
How can I fix this error?
WPBeginner Support says
For that specific error, you would want to follow our guide below:
https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-wordpress-white-screen-of-death
Admin
cristi says
Hi, i have change by mistake my url and now the domain wp admin login url bring me to other site and i cont have ftp access how i can change back them?
WPBeginner Support says
You can either reach out to your hosting provider or if you have phpMyAdmin access you could change the options table and update the URL and address.
Admin
Ankit says
define(‘WP_HOME’,’https://www.example.com’);
define(‘WP_SITEURL’,’https://www.example.com’);
where do these two lines add in wp-config.php file?
At Last OR At Start?
Please clarify
WPBeginner Support says
As we state in the article: paste the code just before the line that says ‘That’s all, stop editing! Happy publishing’.
Admin
Paek says
Thank you so much!!!
Adding the wp-config lines solved it.
Thanks!
WPBeginner Support says
You’re welcome
Admin
Ada says
Thank you so much for your post. I’m a newbie with WP. These lines worked for me
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
I also changed the below line from false to true.
define( ‘WP_DEBUG’, true );
WPBeginner Support says
Glad our recommendation could help, the WP_Debug you should be able to return to false should you want
Admin
mojo says
thank u so much after spending so much time after deleting that .htacces and restart my mac open the website finally thanks for ur time
WPBeginner Support says
You’re welcome, glad our recommendations could help
Admin
Goxi says
You safe my life man! Just messed around the login wp admin site if it wasn’t for this tutorial I would never have solved the problem!
WPBeginner Support says
Glad our guide was helpful
Admin
Tomer says
Thank you very much for this tutorial!
I have tried these methods and managed to temporarily fix the problem.
The thing is, that after everything seems to be working again, the next day it happens again. Without me changing anything at all. Any tips on that?
WPBeginner Support says
You would want to reach out to your hosting provider to ensure there is nothing on their end that could be causing this conflict
Admin
Sulivan says
For those who ended up here an after all steps could’t solve this, check if you changed table prefix. I have changed mines and just figured out that there are some usermeta that stores the old prefix.
WPBeginner Support says
Thanks for sharing what was the issue on your site
Admin
shahin says
thank you bro , amazing content and very useful
WPBeginner Support says
Glad you like our content
Admin
Julie says
Tks a lot ! You save me !
WPBeginner Support says
You’re welcome, glad our guide could help
Admin
Ann says
Thanks a lot to all of you, and specially to Hand: Changing back php version to 7.3 solved this for me!
WPBeginner Support says
Glad the recommendations could help you
Admin
Hand says
I had this issue and spent an entire day trying every possible solution mentioned here and elsewhere without any progress. Then I remembered that I had changed the PHP version from 7.3 to 7.4 on my hosting’s control panel (DirectAdmin). Changing back php version to 7.3 solved this for me.
WPBeginner Support says
Thanks for sharing the solution that worked for you
Admin
Jeff says
This worked for me.
Joe says
I’ve just worked out that PHP 7.4 missed three of the extensions we had installed on PHP 7.3:
php74-php-opcache
php74-php-process
php74-php-soap
As soon as they were enabled and provisioned the wp-admin 404 error disappeared. Hope that helps you to upgrade to 7.4 trouble-free!
Shiv says
Hi
I followed this article and in my case i found one plugin was causing this issue.So it found it by renaming each plugin and keep trying the login and once i reached this plugin and renamed it …admin login worked.So…i renamed back rest of the plugins to their original names and keep this once renamed and admin worked and later i sorted my plugin
Thanks
WPBeginner Support says
Glad you were able to get your site working and thanks for sharing the method you used for other users with this issue
Admin
mark says
I deleted the htaccess file as instructed, and now I can’t get a login screen at all. No access to my site (404)
WPBeginner Support says
To check for the possible issues, you would want to go through the steps in our article here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Admin
Di says
Thanks, you’re a life saver. The .htaccess hack worked!
WPBeginner Support says
Glad our recommendation could be helpful
Admin
gho says
I owe you one! I used the codes and it’s simply worked. Big thanks wpbeginner!
WPBeginner Support says
Glad our guide could help
Admin
Giang Nguyen says
thanks man. Your Update Site URL works!
I tried to manually install piece by piece in my local macbook, to learn how wordpress work, and missing your piece!
The install manual doesn’t really have this kind of info =)
giang
WPBeginner Support says
Glad our recommendation could help you
Admin
Todd says
I’ve had this issue before many years ago and I think my fix was the same this time as it was then. After trying many many suggestions above, what finally did it for me was clearing my chrome browsing history. Someone mentioned trying that and not working, but this was not actually offered as a solution so I thought I would post it. Thanks!
WPBeginner Support says
Thanks for sharing what worked for you
Admin
Peter says
I was having a login error where my login page keeps refreshing and redirecting me back to the login screen. And for me (I tried all of the above solutions) and none of them worked.
Then I checked the error_log file on my WordPress site and saw that the problem I was having said “WordPress database error Disk full”
As a result, I went into my wp-config.php file and added the following code to file right above the text line where it says in the file “* That’s all, stop editing! Happy blogging. */”.
The code I added is:
define(‘WP_MEMORY_LIMIT’, ‘256M’);
Problem solved.
WPBeginner Support says
Thanks for sharing the solution that worked for you
Admin
Chris says
Thanks for this – it worked perfectly and tehe memory limit solved the problem. I was really angry because all other stuff like plugins, themes, .htaccess didn’t work!!!
Greetigs Chris
purushotham says
i am not able to login my wordpress admin ,getting 404 error.what should i do to reslove the issue.
WPBeginner Support says
For a starting point, you would want to reset your permalinks using: https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-posts-returning-404-error/
If that does not solve the error then you could try the troubleshooting steps in our guide here:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Admin
Travis says
None of these options worked for me… Turns out to be a hosting issue. Called Network Solutions and they said that because my database was over 300mb I needed to upgrade my database because after 300mb they lock you out…. Upgrading by DB fixed the issue. Who knew….?!
WPBeginner Support says
Glad you were able to find the solution to the problem
Admin
Chris says
How did you upgrade the WP database? I think this may be my problem.
WPBeginner Support says
You would reach out to your hosting provider and they would let you know if you need more space for your database similar to Travis
Admin
hamdi says
Defining these lines ON TOP OF wp-config.php helped. They don’t help if you put them at the bottom.
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
WPBeginner Support says
It should still work if you place it at the bottom of the wp-config file, there may have been a problem with where you placed it depending on what’s in your specific wp-config file.
Admin
Joe G says
Nothing worked for me until I went into ftp server and edited index.php in the site’s root (alongside all of the other wp-related files mentioned here), and set define( ‘WP_USE_THEMES’, FALSE )
This will temporarily break your site temporarily (no error codes, just white screen), though my site loading wasn’t the problem. This allowed me to finally access my dashboard through the login site, where I then put a brand new theme on and fixed what I thought might be the culprit (I made the mistake of redirecting my “Home” link on my menu to an exterior site).
After removing the “Home” link, (or just to be safe, the menu in general), and creating a new menu with only the pages in question I wanted to use, I re-set the ‘wp_use_themes’ to TRUE and we’re back off to the races again!
WPBeginner Support says
Thanks for sharing what worked for you
Admin
Mohsen says
I’ ve tested all of these solutions, but my problem has not solved.
WPBeginner Support says
If none of these methods worked then you may want to reach out to your hosting provider to ensure there aren’t any issues on their end.
Admin
Matt Nigro says
My issue is that everyone has access to my site…no login required! Can someone help.
WPBeginner Support says
Do you mean people can view your site or people can log in to your site? If you mean the login then if you’ve logged in once, WordPress should log you back in but your site’s visitors would still need to log in. If you visit your site in an incognito browser you should see what your visitors see.
Admin