You log in to WordPress, only to find yourself staring at the login screen again and again.
If this is happening on your site, don’t panic. We’ve helped countless WordPress users troubleshoot this exact problem, and in most cases, the fix is much simpler than it seems. The culprit could be anything from a corrupted cookie to a plugin conflict or an SSL setting.
In this guide, we’ll walk you through how to fix the WordPress login redirect loop step by step.

What Causes the Login Page Refresh and Redirect Issue in WordPress?
When you log in, WordPress checks your username and password and then uses a browser cookie to keep you logged in. If WordPress can’t create or recognize that cookie properly, it may send you right back to the login screen.
Here are the most common reasons why this happens:
- Login Cookies: Your browser fails to save the login cookie properly.
- URL Settings: The WordPress Address and Site Address settings are incorrect.
- Corrupt .htaccess File: Your server configuration file might be damaged.
- Plugin Conflicts: A plugin might be interfering with the login process.
- SSL redirect loop in CDN: Your SSL setting in Cloudflare or your CDN could be the culprit.
Sometimes, this issue can also be linked to other errors. These include the error establishing database connection or the white screen of death.
With that in mind, let’s troubleshoot and fix the WordPress login page redirect and refresh issue. You can use these quick links to jump to a specific method:
- Method 1: Clear Cookies to Resolve Login Issues
- Method 2: Update WordPress URL Settings
- Method 3: Delete .htaccess File in WordPress
- Method 4: Deactivate Your Plugins
- Method 5: Switch to a Default Theme
- Method 6: Fix the Cloudflare or SSL Redirect Loop
- Video Tutorial
- Frequently Asked Questions About WordPress Login Errors
Before we proceed, we highly recommend you
Note: If you want to try the advanced steps in this WordPress tutorial, then please create a backup of your site first. See our guide on manually creating a WordPress database backup.
Method 1: Clear Cookies to Resolve Login Issues
WordPress uses cookies for login authentication, so the first step in troubleshooting WordPress login issues is to clear your browser cookies and cache. Clearing them forces your browser to drop corrupted or outdated session data that might be blocking a successful login.
In Google Chrome, simply click on the browser settings menu and then select More Tools » Clear Browsing Data.

This will launch the Chrome Settings page with a ‘Clear Browsing Data’ popup displayed on the screen.
From here, you need to select the ‘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. You can usually find this option in your browser’s ‘Privacy and Security’ settings.
After doing that, restart your browser and log in again to your site. This often fixes the issue for many users.
We have a complete guide with screenshots showing how to clear the cache and cookies in all major browsers.
Method 2: Update WordPress URL Settings
WordPress comes with settings for the URL of your website and the URL of your WordPress installation.
If you have access to your WordPress admin area, then you could see this option on the Settings » General page.

If these URLs are incorrect, then WordPress will redirect you back to the login page.
Since you are unable to access the WordPress admin area, you will need to edit the wp-config.php file to fix this issue.
The wp-config.php file is a special file in WordPress that contains your important WordPress settings. You can access it using an FTP client or via the File Manager app in your WordPress hosting account dashboard.

You will find the wp-config.php file in your site’s root folder. Simply edit the file and paste the following lines of 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.
Note that this method hardcodes the values. You won’t be able to change them in the WordPress Settings » General screen unless you remove this code later.
You can now visit your WordPress website and try to log in. Hopefully, this will have fixed the issue for you. If it didn’t, then continue reading for additional troubleshooting steps.
Method 3: Delete .htaccess File in WordPress
Sometimes, the .htaccess file can get corrupted, which can result in internal server errors or the login page refreshing error.
Simply access your website using an FTP client or via the File Manager app in your hosting provider’s dashboard.
Once connected, locate the .htaccess file in the root directory of your website and download it to your computer as a backup.
If you can’t find your .htaccess file, this guide on why your .htaccess file may be missing can help you.

After that, go ahead and delete the .htaccess file from your website.
Next, open the wp-admin directory. If you see a .htaccess file there, go ahead and delete it as well.
This file is often created by security plugins to limit access. Deleting it can resolve conflicts, but you may need to check your security plugin settings later.
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 in to WordPress.
Once you are logged in, simply go to the Settings » Permalinks page in the WordPress admin panel and click on the ‘Save’ button without making any changes. This will generate a new .htaccess file for your website.
Method 4: Deactivate Your Plugins
Sometimes, WordPress plugins can cause this issue, especially if there is a conflict between two plugins.
To easily deactivate all your WordPress plugins, connect to your website using an FTP client or via the File Manager app in your web hosting account dashboard.
Once connected, go to the /wp-content/ directory. Inside it, you will 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.
Once you have deactivated all plugins, try logging in to your WordPress site. If you succeed, then this means that one of your plugins was causing the issue.
Method 5: Switch to a Default Theme
WordPress themes can also cause conflicts after an update. To see if your theme is the problem, you will need to deactivate it.
Connect to your website using an FTP client. Go to the /wp-content/themes/ directory and rename your current theme directory to ‘themes_backup’.
Once you have done that, try logging in again. WordPress will automatically look for a default theme like Twenty Twenty-Five to use instead.
If you don’t have a default theme installed, you will need to upload one via FTP first. If you can log in now, it means your theme was causing the issue.
Method 6: Fix the Cloudflare or SSL Redirect Loop
If you use Cloudflare or any other CDN, then your SSL settings can prevent you from logging into your WordPress admin dashboard.
A common culprit is Cloudflare’s Flexible SSL mode. With Flexible SSL, visitors connect to Cloudflare over https, but Cloudflare connects to your WordPress server over plain http.
This can confuse WordPress because it sees the incoming connection as HTTP and tries to redirect it to HTTPS. Cloudflare then sends the request back to your server over HTTP, triggering the same redirect again. The result is an endless redirect loop that can lock you out of your WordPress admin area.
To fix the problem, you’ll need to change two settings.
First, log in to your Cloudflare dashboard and select your website. Then go to the SSL/TLS » Overview page and open the Custom SSL/TLS settings.
Change the encryption mode to ‘Full’ or ‘Full (strict)’.

Next, you need to tell WordPress that the visitor is on a secure connection.
Connect to your site using an FTP client like FileZilla or the File Manager in your web hosting dashboard. Then open the wp-config.php file in your site’s root folder.
Add the following code at the top of the wp-config.php file.
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
This tells WordPress to recognize the connection as HTTPS when Cloudflare has already established a secure connection with the visitor. Save the file and upload it back to your website.
Now try logging in to your WordPress admin area again. If Cloudflare’s SSL settings were causing the redirect loop, you should be able to log in normally.
Video Tutorial
If you need visual instructions, then please watch the video below.
Frequently Asked Questions About WordPress Login Errors
Here are some questions that our readers have frequently asked when facing any login errors in WordPress:
Why does my WordPress site keep refreshing?
This happens when your browser cannot verify your login credentials correctly. It is usually caused by a cookie error or a conflict with your WordPress URL settings.
Why is the WordPress login not working?
The most common reasons are incorrect passwords, plugin conflicts, or a corrupted .htaccess file. We recommend clearing your browser cache and cookies as a first step.
Why does WordPress keep logging me out?
WordPress will log you out if it fails to authenticate your session cookie. This often occurs if your Site URL and Home URL do not match in your settings.
How to force login in WordPress?
To make your entire site private, you can use the ‘Force Login’ plugin. This redirects any non-logged-in visitor straight to the login page.
Why does my website keep logging me out?
If you are constantly logged out, your browser settings may be blocking the site’s cookies. Ensure that your browser allows data to be saved for your domain.
What causes failed login attempts?
Failed attempts are usually triggered by entering the wrong username or password. Security plugins may also block your IP address if there have been too many recent attempts.
Is it safe to clear the cache on WordPress?
Yes, it is perfectly safe to clear your browser cache. This only removes temporary files on your computer and forces the browser to load the latest version of your site.
How do I require login to view a WordPress site?
You can password-protect posts or use a membership plugin like MemberPress. This lets you control exactly who can see your content based on their login status.
To get started, see our tutorial on how to require login to view a page in WordPress.
Are you experiencing other common WordPress errors and need to find a way to fix them? Then check out our beginner’s guide to troubleshooting WordPress errors.
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.

Eric
I had to rename /wp-content/object-cache.php. Hope that helps for anyone who the other steps don’t work for.
Alisha
When i type myurl.com/wp-admin the page shows blank. I can’t see any login panel either nor does my website opens… what is the cause?
WPBeginner Support
Please see How to fix the WordPress white screen of death.
Admin
Akeem
editing the wp-config worked like a charm. thank you so much!
Jeff
If you are having this issue, and nothing suggested here will work – log into the Cpanel and go into PHP My Admin, run a repair on your database table.
Micah
Adding the code to the wp-config.php solved this for me.
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
Thanks for the article! It took me 3 hours sifting through other posts before I found your post and the resolution that I needed!
Micah
MuhdNurHidayat
Thank you very much! You saved my day!!
Gordon
This problem can also occur if your server hosting Wordpress has run out of disk space. Freeing up disk space can solve it.
Victor
You saved my day. I lost hours trying to find what the hell was wrong… thanks dude
Angelo
Deleting the .htaccess worked for me. Thank you
Friday0
Sir please help me look at what am getting it started this night.
Fatal error: Call to undefined function
wp_is_mobile() in /home/u318928021/
public_html/wp-login.php on line 39
I don’t know what to do
WPBeginner Support
Seems like a plugin or your WordPress theme is causing this error. Deactivate all your WordPress plugins and check if this resolves your issue. If it does then you need to reactivate plugins one by one. This will help you find the plugin causing the error. If deactivating all plugins does not resolve the issue, then switch to a default WordPress theme like Twenty Fifteen. If switching theme resolves the issue, then the problem is your with your WordPress theme.
Admin
Luis
Thanks, it was a plugin conflict. I just deleted some useless crap via ftp and now it’s all sorted.
Thomas Le Coz
You guys saved my ass. I was stuck outside a client site after messing with a SSL certificate and some stuff on managed account.
Never encountered this issue before, got saved by your guide.
Thanks
Eva Duli
Nothing of these work for me. I want to work the site localhost but when I am trying to login in the admin it redirects to the old admin login. Do you have any idea?
Marco Panichi
My problem was that I hadn’t renew the database and the provider denied my user to insert/update the database.
The error I received was: “INSERT command denied to user ‘Sqlxxxxxx’@’xx.xxx.xxx.xxx’ for…”
So the solution in my case was:
1) activate the debug into wp-config.php > define(‘WP_DEBUG’, true); in order to discover the problem
2) renew the database
Hope this help!
JohnnZenith
I have a wordpress.com blog and all these instructions either are not relevant or I do not understand them, so I guess i’m going to leave it.
WPBeginner Support
These instructions are for self hosted WordPress.org sites. Please see our guide on the difference between WordPress.com and WordPress.org
Admin
chris
I cant find my .htaccess file? I can find it in my rootfirectory but not on my subdomain (where I have a whole new wordpress site). What do I do? It is my first time ever to log in to my subdomain wordpress.
Kenny
The dreaded Internal Server Error and web host support quickly identified a corrupted .htaccess. Spent next 3 hours trying to find how to use my ImportBuddy when I didn’t have WP Admin access. Finally thought to check WPBeginner, found the .htaccess issue above and 30 seconds later had fixed the issue. Next time I come here first!
Thanks guys and gals.
Drew
Changing the wp-config.php file did it for me! This is the second time I’ve had this issue in two weeks, so I think the fix via htaccess was only a temporary solution.
joel
Seriously a life saver! Corrupted .htaccess files was my issue. But following your steps helped me solve it. Much, much appreciated!
Sumdi
Its working
Have rename .htaccess and update WP_HOME, WP_SITEURL to proper URL in wp-config.php file….
rubenjm
I had this issue, tried all these options and none worked for me.
Finnally solved it… apparently my database was overloaded!! I had to login through phpmyadmin and delete and clean some tables. Hope it helps someone!
Moises
Which tables clean you?
Liviu
I did all of the proposed solutions, but nothing works for me! It keeps refreshing and redirecting it back to the login screen. Changing the folder of my current theme gives the white screen of death. It doesn’t revert to the default theme. Any other idea, please?
Being at a dead end, I’m thinking to download all the site through ftp, make a new one site from Wordpress and then upload one by one all my content. I’m worry however if I’ll be able to insert all the customization settings afterwards. The current theme was made custom by another person which cannot help anymore. Is it safe to do that? Thanks!
Mary Anne
Thank you so much. I have Wordpress pages built via my account with bluehost. One of my wordpress sites stopped working. I had the white screen of death.
I followed each step in order, until I found the step that worked to resolve my problem. The step that worked for me was, Revert Back To Default Theme. Instead of using an ftp though, because I was having a hard time with my fetch working, I logged into my bluehost account and went into my file manager and then accessed my wpcontent/themes/directory that way for changing the title of my current theme.
this worked perfectly. I was able to log back in and choose a different theme. Thank you again
Mary
Manish
Hello,
Its not working for me. I had made every change into my site as per this tutorial still no luck. Added these two line in web config file.
define(‘WP_HOME’,’http://www.siteurl.com’);
define(‘WP_SITEURL’,’http://www.siteurl.com’);
deleted .htaccess file. but still same problem. My site running on 1&1 hosting.
Please help me.
Thanks
Manish
Umair
Dear manish , there is small change use it will definitely work
1define(‘WP_HOME’,’http://example.com/wp-admin’);
2define(‘WP_SITEURL’,’http://example.com’);
Abdul Ghani
Updating the site URL worked for me!
the wicked noodle
Clearing my cache and cookies fixed it right away. Thanks so much!
Claudia
Update Site URL worked perfect for me! Thank you!
WPBeginner Staff
Contact your web hosting service provider. If they are unable to help then switch to a better WordPress hosting solution.
Louis
Noting work for me… wp 3.9.1, Hostpapa hosting.
WPBeginner Staff
Try checking your server error logs. You can also try increasing php memory limit. Let us know if this helps.
Beck Abad Lastimosa
I have had my site for more than 6 months now and I finally decided to transfer hosting. After the transfer was successfully done, I as still able to access my login page. But these past few days has been a nightmare! I am was able to login to WP under the new DNS but as of this time, this problem suddenly occured:
– Everytime I login to WP admin, I should see the login page right? But what I get is a download of wp-login.php. I have tried checking issues ith the guide of WP Codex. I tried contacting GoDaddy (my new host) but they told me they do not handle coding, etc. Right now, I’m on a dead end! I have tried different browsers but I still get a download of wp-login.php instead of the login page showing itself.
I ould really appreciate it if you can help me.
Thilip kumar
I Check with all the above but unable to login, I can ablre to see the login window, after I submitting login form. I Displays ‘.’ (Dot symbol)
Alison Withers
You’re a godsend!!! Editing the config file to define the site address again did the trick.
Jaka
YES! This did it for me too. Magic! Thanks!
Isak
Did all of the above, nothing works. My main wp-login.php redirects me to one of my subdomains.
This is how the redirect problem occured:
1. My web hotel shut down my site, saying that it had been infected with malware.
2. I changed all my passwords via PhpMyAdmin as well as to the database.
3. I manually updated WP in my root directory as well as 2 out of 3 subdomains (the 3rd one already had the latest version) by uploading the new files and replacing the old ones, since I was not allowed to access my WP admin area.
4. I manually added a .htpasswd and .htaccess to my root WP install and tried to access wp-login.php. I tried my 3rd subdomain (the one with the latest install of WP) first and it worked. After that, I tried my main domain and came to a page saying “update database”, so I did. After that I tried again, but every time I try to reach my root install or any of the other subdomains, I get redirected to my 3rd subdomain.
Any ideas?
WPBeginner Support
Open the wp-config.php file on the root site. Add these two lines to your wp-config.php file:
define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');1-click Use in WordPress
Replace example.com with your own domain. Also delete .htaccess file from all your subdomains and root domain. Once you get access to WordPress admin area on your root domain you need to go to Settings -> Permalinks and just save your permalink structure.
Admin
Jesse
Deleting .htaccess file from root directory worked for me. Thank you!!!
Moaz
none worked for me!
Diane
The extra lines in the wp-config worked! I love you! Thanks
carl
WP-config worked for me too! I could kiss you!
Jonny
WP_SITEURL did it for me. Seems illogical but it worked, so thanks for the tip! This only started happening recently to me – I wonder if it’s more prevalent with subdirectory installs with newer versions of WP.
igor
ok I deleted all plugins and it works but whenever I add any plugin it does the same thing
Anna
Thank You
It was really helpful, great info … Resolved y issue by adding site name in wp-config.
Regards,
Peter Evans
Recently WP started getting me to login ever 5 of so minutes. I noticed that my wp-config.php did not have the following lines
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
and when i inserted then the need to login was a less but I was then told that my session has expired and I needed to relogin in.
This is very frustrating and I would be greatful if you could assist me. I am using WP 3.6.1
Peter Evans
Aamna
and Yes if your wp-config.php file does not provide you a solution.
Try going to functions.php of your theme via ftp and add same two lines right below the <?php line and upload again. here you go !!!
it works for me
Aamna
Thanx a lot the site URL was the solution … Thank you Thank you Thank you
W.J.Kok
I use Epic Browser for testing because that browser will not store cookies (by default). Therefore clearing the caches will not delete all my stored passwords in the process.
W.J.Kok
Set chmod wp-admin at 750 did kill my admin login access. So, now I use 755.
Brent Norris
Had a special case of the redirects all day. This particular post, out of about 20 keyed me in on a solution. Just wanted to say, “thanks!” Your perspective was a refresh after ten hours chasing down a solution.
It was the part about generating a new .htaccess file that made the difference for me. Wish I could be more helpful to others but the problem I was having wasn’t very related and wouldn’t make a lot of sense to your readers.
Aloha
Editorial Staff
So glad that we were able to help you Brent
-Syed
Admin
Adrian
Thanks a lot for the ‘Update Site URL’ fix. That solved an issue I was battling with for a while and saves me from any further headaches.
Omar
This was really frustrating me but thanks to your tip on updating the URL my site is now working. Thanks!
Haseeb Ahmad Ayazi
This error is very rear with WordPress but mostly occir in Blogger
Paul
I normally get this error when working with multisite, normally it’s a cookie path problem which can be fixed by changing the wp-config.php.
Robert Connor
I really needed this tutorial it happens to me all the time usually a plug in conflict. I am addicted to plugins. Thanks staff! Have a great day on purpose…
Kartik eye
I had the same issue, few days ago. I was trying to enable the wpmultisite function for my new website with sub directories. My website is hosted on bluehost. I did everything step by step. But after editing all the files like wpconfig.php and htaccess. When I finally tried to login, I was getting a redirect to the same wp login page. I disabled the multiste and then everything was fine again. Please can you help with this?
lelebon
I tried everything — I said every little advice here — to no avail. Until I noticed I was using wp_config.php instead of wp-config.php. That simple! It solved my problem. HURRAY!!
Anyways, thanks for the tips. Hope I can help someone too.