Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Fix WordPress Login Page Refreshing and Redirecting Issue

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.

Fixing the login page redirect and refresh issue in WordPress

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

Subscribe to WPBeginner

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.

Login page redirect issue in WordPress

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.

Clear browsing data in Google Chrome

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.

Clear cookies and cache in Google chrome

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.

WordPress URL settings

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.

Editing wp-config.php file via FTP

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.

Delete .htaccess file in WordPress

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.

Rename plugins folder to deactivate all 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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

336 CommentsLeave a Reply

  1. this is one of the best tutorial that fixed my issue.. ive tried so many and it just messed my code.

    what i did was just delte my htacess and generated a new one.. and im even able to login to my wp admin already

  2. Thank you. Really helped after a VERY frustrating day to find out it was a broken plug-in. Many thanks :)

  3. I have tried everything and nothing works!! I then tried re-registering, but that completely wiped out my dashboard. I’m getting extremely frustrated over this!!

  4. My site doesnt login to dashboard or takes time to load the /wp-login page which after inserting the login details it takes forever to load … but on a different network it loads well what could be the problem

  5. Thank you so much for this article! Thankfully mine was an easy fix and I just needed to delete the cookies from WP.org so I could sign in. I had just reset my password before the error occurred where it kept refreshing the log in screen so that may have had something to do with it.

  6. Hi guys,

    I’ve tried everything and nothing worked. I had the same problem with another computer and after about 5 attempts I got in but this morning I tried logging in with another computer, it’s happening again. The page redirects to mysite.com/wp-login.php. Any ideas?

    Thanks all for your help!

  7. LAST RESORT THAT WORKS
    You can temporarily disable redirection from the wp-login.php file and then delete all newly installed or updated plugins.

    1. Disable redirection by opening the file wp-login.php

    2.Scroll down to the line where you have the code “do_action( “login_form_{$action}” );”
    Mine was around line 461

    3. Comment out that line of code to disable redirection

    4. Save the file. You will now be able to login using example.com/wp-login.php

    5. Disable or delete all recently installed plugins especially plugins that manage access control functionalities

    6. Clear your cookies and cache

    • Should i continue to comment the codes?because i am not sure which plugins that cause the problem.Before this i have disable all the plugins manually, but still cannot access wp-login.php.

  8. define(‘WP_HOME’,’http://example.com’);
    define(‘WP_SITEURL’,’http://example.com’);

    i change this examples.com to my site url, now not able to login. it shows 401 unauthorized. After changing the original file wp-config also, not able to login. any idea?

  9. Turned out to be one of my plugins that was giving me grief, simply went into my Ftp and deactivated them and got rid of the last plugin that i installed, happy days fixed the problem, many thanks guys your knowledge is invaluable , respect!

  10. Tried these to no avail. My host says “The site ran out of space” except that there is 3gb free, so that’s not true. This problem is on 40+ sites and happened at the same time, so it’s not me but I have grumpy customers expecting me to fix it.

    Site works but login does not,

    I get :

    https://example.com/wp-login.php?redirect_to=https%3A%2F%2Fexample.com%2Fwp-admin%2F%3Fdoing_wp_cron%3D1512599810.4524919986724853515625&reauth=1&doing_wp_cron=1512600006.5833470821380615234375

    Any thoughts welcome. Thank you

  11. Finally! The delete .htaccess file works fine for me! Also have to go to Settings > Permalinks and click Save to generate a new .htaccess file.

      • Hi August,

        If you cannot login to your WordPress site, then you can refresh permalinks via FTP. Simply connect to your website using an FTP client. After that download your .htaccess file to your computer as a backup. Now delete the .htaccess file from your server. You can now try to log in to your website.

        Once logged in you can go to Settings > Permalinks page and click on the save changes button to generate new .htaccess file.

        Admin

  12. My problem was customers needed to try login 3 times before it goes through for Chrome, IE and Opera but not for Firefox users. I am using Woocommerce and WP (currently the latest although it started happening about the last upgrade or earlier). Tried clear cache, delete htaccess. Didnt work. The following worked:
    Added a new page and re-direct the “Woocommerce|Account” (login) page to the new page.
    This worked. I then pointed the Account page to the original Account page and it worked. Guess something got refreshed. Thanks for the tips anyhow.

  13. after changing site URL through the dashboard the whole site went to 404. Your define(‘WP_HOME’,’http://example.com’);
    define(‘WP_SITEURL’,’http://example.com’);
    solved that issue, but now I need to move my site to the root directory and don’t know how because of this fix.

    HELP!

  14. Thanks for the guide.
    Updating the site URL using

    define(‘WP_HOME’,’https://example.com’);
    define(‘WP_SITEURL’,’https://example.com’);

    Worked for me :-)

    • Pro Tip : I have the same problem, check your wp-config.php file and locate : WP_ADMIN_COOKIE_PATH or ADMIN_COOKIE_PATH and erase it!

  15. All of these steps did not fix my problem.

    I think I’ve found part of the cause though.

    When I type in mysite.com/wp-admin I am redirected to mysite.com/wp-login.php only the redirect is incorrect.

    Rather than redirecting to mysite.com/wp-admin after login it is redirecting to mysite.com/domains/mysite/wp-admin

    Any help out there for fixing this?

  16. Hi.
    I moved my site from my local host to live following the steps in your article related to that.
    I faced some login/redirect issues.
    I tried all the steps as listed in this article.
    When I revert back to default theme, the page only shows a text of my domain name with no other content.
    When I delete .htaccess file, it shows my home page but when I click on login button it shows 404 error NOt Found
    When I update site url, I also get 404 error when I click on login button or go to domain/wp-admin

    What else can I try to troubleshoot?

    Will appreciate your help.
    Thanks.

  17. I am not able to understand what is the problem with my website. In home page after 5 posts i am not able to post anything, in the dashboard, it redirects me to the post page. and revolution slider is not activating in my site.

  18. I can not log in it gives me a page can not be founed I think it is because my web page name was altered in an plug in

  19. Everytime I log in I am redirected to the My sites page (light Blue) I want to go directly to the standard dashboard. Can someone help me fix this problem

  20. hI! I have just paid my renewal and when I try to login to my account it keeps telling me error?? Why is this ?? Thanks.

  21. thanks a lot..this is so helpful to retrieve wp site as mush as easier way.every pin points are so understandable and worth to try it.oncw again thank you so much

  22. Why can’t I access my WordPress dashboard anymore? It’s driving me insane. I have tried resetting the password, several times, but it keeps telling me there is no account with that name. I need to publish a blog but I can’t. HELP!

    • Hi Adele,

      Instead of username, try entering your email address in the username field to login. This should be the same email address you used to reset password. Hope this helps.

      Admin

  23. I could not login to wordpress site went to cpanel and deleted plugin I just installed and fixed problem

  24. Hi there,

    I have a weird issue with login on WP: my problem arise with domain redirect because I have a wp site into a subfolder of my domain (www.example.com/site) and a redirect from my provider (www.example2.com) that I setup to point at http://www.example.com/site.
    WP works great except for “login”: I can access from http://www.example.com/site but not from http://www.example2.com. From this last one it happens that pushing “Login” button simply get no result. Do you have any idea? Both WP_HOME and WP_SITE_URL point to http://www.example.com/site

    Thanks a lot for your support and your amazing site

    • Hi Giorgio,

      We are not sure we understand your issue correctly. However, it seems like example2.com is already redirecting to your other website. In that case, you’ll not be able to login from there.

      Admin

  25. I am running a WP website, Its about mobile products tells Specifications and features of smartphones. I tried to activate a price filter plugin for my website but they said I have to activate the woo commerce plugin first then filter plugin will work. I did that. But it was a big mess. so I delete the both woo commerce as well as the first one price filter plugin. But now I am facing an issue. when ever I click on my any product on my website or from google search result it comes back to my site homepage. Can anyone help me out about it? I am a beginner. Thanks

  26. i Just copied all the wordpress folder to one site to another & Import All my database but… after login, page redirect to previous site….
    what should I do?

    • Hey Phil,

      Before you reinstall please try these:

      1. Try to access login page by visiting http://www.example.com/wp-login.php

      2. Try updating your permalink structure. Connect to your website using an FTP client or File Manager in cPanel. Locate the .htaccess file in the root folder of your website. Download the file to your computer as a backup and then delete it from your website.

      Admin

      • Had the same problem though all I had to do was to reset my admin user password to something stronger, cleared the browser cache and everything started working fine

  27. None of these solutions worked for me, nothing. I was completely perplexed. Finally, I went to the WordPress forum on my hosting site, Dreamhost, and found a thread about login problems. Turns out I didn’t have my auth keys and salts defined. A quick cut and paste into my wp-config.php file and boom! I’m in! So my addition is to check with your hosting service and see they have specific instructions or recommendations. IDK why my wp-config.php was wrong in the first place, but so glad I found the fix! This has been frustrating!

  28. Thank you so much, deleting the .htaccess did the trick, just remind people to show hidden files on file manager html root of their cpanel

  29. hey thanks your last method update url method really works for me. now i am able to log in my wordpress admin panel

  30. Super helpful, thank you. I had 2 or 3 plugins running that did logins and membership and they basically made my site inaccessible.

  31. The site url option:

    define(‘WP_HOME’,’http://example.com’);
    define(‘WP_SITEURL’,’http://example.com’);

    worked for me. The problem happened when I moved a site from a .co.nz to .nz url.

    Thanks.

  32. Sir i have uplaod database file and and backup for my old website on new domain but it is redirecting to old website and i am unable to access WordPress Login page

    • Hi Awais,

      You will need to change the site URL. You can do that in your wp-config.php by adding this code:

      define('WP_HOME','http://example.com');
      define('WP_SITEURL','http://example.com');

      Admin

  33. Last option worked for me just fine (Update Site URL)

    define(‘WP_HOME’,’http://example.com’);
    define(‘WP_SITEURL’,’http://example.com’);

    I wish i could know what caused the problem and why that solution was the one that worked, in order to prevent having this issue again and be alert of else issues could produce the origin problem.

  34. Having a problem login into wordpress wp-admin page. No error messages, but keep getting redirected to the login page itself.

    Wrong credentials return appropriate error message, but not in this case. No white screen of death also. Just the login page reappearing, after shaking a couple of times.

    Tried all suggested methods, including clearing cookies, deactivating plugins, deactivating theme. And deleting .htaccess, making appropriate entries for site url and home url in wpconfig, enabled wp_debug too. Tried all tricks recommended.

    Interestingly, this has happened in two different servers, with two different staging sites (both in advanced stages of development) – on two different servers…one windows, one linux. These were working fine till last night…and then this sudden has happened since morning.

    Can any one suggest what the problem could be?

    • Well I had the same problem yesterday just after installing WordPress. Check in your host cPanel if varnish caching has been enabled. If so, go ahead and disable it. Wait for 30 minutes and then try logging in.

      • You my friend deserve a pat on the back. After struggling for nearly the whole day and trying everything else out, your solution is what finally worked. I disabled varnish and voila, I am in :)

  35. Nothing work for me ? dont know how to fix it? please help ?
    Cant login to wordpress dashboard
    it says sorry you are not allowed to access this page

  36. I was locked out. At first I doubted my password and tried to get a reset but my admin log in page was just doing circles with my website front page. I tried every action suggested – even managing to get the dreaded blank, white page.

    So I started putting everything back as it was to try again another day. But with a deleted .htaccess file and the theme and plug in still deactivated I managed to get a password reset from WP – I’m in!

    Thank you to everybody who commented.

  37. follow this tutorial A to Z problem not solved. i couldn’t login to my wp-admin since i migrate my wordpress website from localhost wamp to web server using cpanel. the front end design not rendered properly and also i couldn’t login to my wordpress admin

  38. Just learned this … from a Bluehost help desk. To see what’s on the server press Shift/ Reload

  39. I have a slightly different problem — when I am logged off wordpress and on my website when I click on the main menu to select a page I get redirected to the WordPress Login page. It is sporadic and seems to happen with several different links. This is also happening to visitors to my site so it’s not just my computer. .
    Thanks, Cathy

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.