Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Fix WordPress Login Page Refreshing and Redirecting Issue

When we try to log in to our own WordPress websites, there have been times when the login page keeps refreshing and redirecting, preventing us from accessing the WordPress admin area.

If you’re experiencing this, you’re not alone. The WordPress login page refreshing and redirecting issue is common and frustrates many WordPress site owners. That being said, we have tested several tried-and-true methods to resolve the problem.

In this comprehensive guide, we’ll show you how to fix the WordPress login page refreshing and redirecting issue. Let’s dive in and get you back into your WordPress dashboard so you can regain control of your website!

Fixing the login page redirect and refresh issue in WordPress

What Causes the Login Page Refresh and Redirect Issue in WordPress?

The WordPress login page refresh and redirect error (also called the WordPress login redirect loop) is usually caused by incorrect WordPress URL settings or failure to set login cookies.

Normally, when you log in, WordPress validates your username and password and then sets a login cookie in your browser. After that, it redirects you to the WordPress dashboard.

If WordPress fails to set the login cookie correctly or your WordPress admin area URL is incorrect, then you will be redirected back to the login screen instead of the admin dashboard.

Login page redirect issue in WordPress

Login issues can also be caused by different WordPress errors, such as the error establishing database connection, internal server error, 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:

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 how to manually create 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 the simplest one. You will need to clear your browser cookies and cache.

In Google Chrome, simply 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 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.

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 log in. This should fix the issue for most folks.

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 had access to your WordPress admin area, then you could see this option on the Settings » General page.

WordPress URL settings

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.

Editing wp-config.php file via FTP

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 one 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 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.

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 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.

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 the WordPress admin is inaccessible.

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: 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 will need to deactivate it.

The process is similar to deactivating plugins. Connect to your website using an FTP client. Then, you must 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 problem reappears, then you will need to contact your theme’s support or switch to a different WordPress theme.

Method 6: Reinstall WordPress Core

In rare cases, the persistent login page refresh issue might be caused by corrupted WordPress core files.

These core files are the foundation of your WordPress website and manage essential functionalities. If these files become damaged or overwritten with incorrect code, it can lead to various errors, including login problems.

First, head over to WordPress.org and download the latest version of the software. Once downloaded, unzip the file on your computer. This will create a folder named ‘wordpress’ containing all the necessary files for the reinstall.

WordPress files

Next, you’ll need to connect to your website using an FTP client or the file manager provided by your hosting company.

Once connected, navigate to the root folder of your website. This is the main directory that contains folders like wp-admin, wp-content, and wp-includes.

Upload core WordPress files

At this stage, grab all the files from the ‘wordpress’ folder on your computer and upload them to your website’s root directory.

Your FTP client will ask you to confirm overwriting any existing core files.

Since you’re deleting corrupted WordPress core files and replacing them with new ones, choose ‘Overwrite’ and select the option to ‘Always use this action’ to avoid needing to confirm each file individually.

Overwrite core files

Finally, click ‘OK’ to begin the upload process. Your FTP client will replace the core WordPress files on your website with the fresh ones from your computer.

Once the upload is complete, visit your website to see if the error is fixed. If the login issue is caused by a corrupted core file or malware, the error message should be gone, and you should be able to log in successfully.

Video Tutorial

If you need visual instructions, then please watch the video below.

Subscribe to WPBeginner

What to Do If You Can’t Fix WordPress Login Redirect Issue

If you have tried everything from clearing browser cookies to deactivating themes and plugins, but the issue still exists, then you can try asking for support in the WordPress community.

Users from groups like the WPBeginner Engage Facebook group may have experienced the same problem as you and can provide pointers on what to do to resolve the login page issues.

The WPBeginner Engage Facebook group

Other than that, you can reach out to WordPress support solutions like WPBeginner Pro Services. We offer emergency premium WordPress support, where experts can pinpoint what’s happening with your website and address the root cause of the problem.

You can also hire our WordPress maintenance services to prevent problems like malware, high downtime, and outdated WordPress from affecting your website in the first place.

WPBeginner Pro Services

Feel free to book an appointment with our team today to see what we can do to fix your website.

Learn More WordPress Troubleshooting Solutions

Are you experiencing other common WordPress errors and need to find a way to fix them? Here are other articles you can check out:

We hope this article helped you resolve the WordPress login page refreshing and redirecting issue. You may also want to see our complete WordPress troubleshooting guide or check out our top picks for the best WordPress plugins and tools to grow your site.

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. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

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

362 CommentsLeave a Reply

  1. Eric Osman

    The solution for me turned out to be something else, and I would think other people would benefit from my solution, so how do we get this article expanded to include more solutions?

    Here is what it turned out to be for me..

    When I created my wordpress project, my intent was to call it EricWpFirstSite. I created a chrome shortcut to the wp dashboard. Later, I went to the settings in the wp dashboard, and noticed that my url was shown as EricWpFIrstSite (note the upper case I). I fixed that in the settings to say what I really wanted which was EricWpFirstSite (note the lowercase i).

    After making this fix, whenever I attempted to use my chrome shortcut to get to the wp dashboard, I would attempt to put in my wp password and I would get the login box over and over again. I finally realized that the chrome shortcut was saved as

    localhost/EricWpFIrstSite/wp-admin/

    Note the uppercase I again! When I finally realized this, and edited the chrome shortcut to be

    localhost/EricWpFirstSite/wp-admin/

    then finally everything worked.

    • WPBeginner Support

      Thank you for sharing this for people working on a local installation! For additions to the article itself it takes time for our writers to review solutions and then updating the article but comments work to let us and other users know what you have found :)

      Admin

  2. ned

    None of them worked.
    Then I asked new password via forget my password tool.
    After setting new password it worked.

  3. Jiří Vaněk

    Thank you for the detailed outline of all the possible issues that may arise. I experienced this with one of my websites when the admin area kept redirecting me to the main site, and I had no idea why. It turned out to be a plugin for changing the admin URL. When I deactivated it via FTP, the problem ceased, allowing me to log in and remove the plugin. This really helped me resolve the entire issue because without FTP and renaming the plugin, I would have had virtually no chance of accessing the admin area.

  4. Sjoerd P

    Hey!

    I found another situation in which the problem could occur. First i tried everything you said. No result. My website is hacked so I was using alot of bandwith to solve the issue and the issue itself costed alot of memory (I dont knoww why exactly= =) ). Anyways.

    After reading comments I turned on debug and again I was pointed to my database. It said: user xxx denied from IP XXX. So because I used too much bandwith from my database it denied the request. Anyways just my 2 cents.

    Cheers,

    • WPBeginner Support

      Thank you for sharing another possible reason for users that may run into that issue!

      Admin

  5. Stef

    None of this worked for any of the sites we tried this on

    • WPBeginner Support

      If none of the methods in this article were able to solve the issue on your site we would recommend reaching out to your hosting provider and they should be able to see if there is a specific error on their end.

      Admin

  6. Amnon Jakony

    Deleting htaccess file worked fine for me…

    • WPBeginner Support

      Glad to hear it was able to help you!

      Admin

  7. Harry k

    Thanks for this video and the post. I tried above all of your methods but none of them fixed the issue. read the comment and found a solution as below. Edit HTTPS to HTTP.

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

    to

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

    • WPBeginner Support

      The issue with this method would be that your site would start to show the not secure message as your site would not be using HTRTPS. This can be a temporary workaround but you would want to update your site to use HTTPS after you are able to log in.

      Admin

  8. Tobias

    No luck none of them worked :(

    • WPBeginner Support

      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

  9. Salah

    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

      Glad to hear our guide was helpful!

      Admin

  10. Robert clancy

    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

      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

  11. DK John

    Your first method worked for me. Thank you for this magical guide :D

    • WPBeginner Support

      Glad our guide was helpful!

      Admin

  12. David Kuteesa

    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

      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

  13. Stian

    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

      We hope it helps!

      Admin

  14. WPBeginner Support

    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

  15. branhampaul

    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.

  16. Bryan Veloso

    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.

  17. Alisha

    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

      Glad our guide was helpful :)

      Admin

  18. Øivind

    Thank you! The wp-config.php-metod worked for me!

    • WPBeginner Support

      Glad our recommendation was able to assist :)

      Admin

  19. Ruta

    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

      Glad you found the solution to the issue :)

      Admin

    • Jerry

      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

      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.

  20. Brayton Scott

    Awesome, and simply tutorial. 1st suggestion fixed my site.

    • WPBeginner Support

      Glad our recommendation could help :)

      Admin

  21. Fraser

    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

      Glad our article was helpful :)

      Admin

  22. Sachin Baikar

    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

      Glad our recommendations were able to help :)

      Admin

  23. E

    Thank you for this article. It is a complete lifesaver.

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  24. Philipp

    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

      Glad our recommendation helped :)

      Admin

  25. María González

    Thank you! You just saved my life (at least my job!) and a loooot of time (:

    • WPBeginner Support

      Glad our guide was able to help :)

      Admin

  26. Suraj Handa

    Hey but now its showing that cookies are disable in your browser please enable cookies. What can I do now?

  27. ajay mali

    you are always post great content that really helps a lot to everyone. thank you so much.

    • WPBeginner Support

      You’re welcome :)

      Admin

  28. David Cuff

    Very helpful. Thank you!

    • WPBeginner Support

      You’re welcome :)

      Admin

  29. ibrahim zouadi

    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 :(

  30. Anthony

    This helped like charm :)

    Many thanks.

    • WPBeginner Support

      You’re welcome :)

      Admin

  31. PDN Social

    This was a lifesaver! We were able to follow step-by-step and avoid a major problem!

    Great information!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  32. Jasmeet Singh

    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?

  33. cristi

    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

      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

  34. Ankit

    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

      As we state in the article: paste the code just before the line that says ‘That’s all, stop editing! Happy publishing’.

      Admin

  35. Paek

    Thank you so much!!!

    Adding the wp-config lines solved it.

    Thanks!

    • WPBeginner Support

      You’re welcome :)

      Admin

  36. Ada

    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

      Glad our recommendation could help, the WP_Debug you should be able to return to false should you want :)

      Admin

  37. mojo

    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

      You’re welcome, glad our recommendations could help :)

      Admin

  38. Goxi

    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

      Glad our guide was helpful :)

      Admin

  39. Tomer

    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

      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

  40. Sulivan

    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

      Thanks for sharing what was the issue on your site :)

      Admin

  41. shahin

    thank you bro , amazing content and very useful

    • WPBeginner Support

      Glad you like our content :)

      Admin

  42. Julie

    Tks a lot ! You save me !

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Admin

  43. Ann

    Thanks a lot to all of you, and specially to Hand: Changing back php version to 7.3 solved this for me! :-D

    • WPBeginner Support

      Glad the recommendations could help you :)

      Admin

  44. Hand

    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

      Thanks for sharing the solution that worked for you :)

      Admin

    • Jeff

      This worked for me. :)

    • Joe

      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!

  45. Shiv

    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

      Glad you were able to get your site working and thanks for sharing the method you used for other users with this issue :)

      Admin

  46. mark

    I deleted the htaccess file as instructed, and now I can’t get a login screen at all. No access to my site (404)

  47. Di

    Thanks, you’re a life saver. The .htaccess hack worked!

    • WPBeginner Support

      Glad our recommendation could be helpful :)

      Admin

  48. gho

    I owe you one! I used the codes and it’s simply worked. Big thanks wpbeginner!

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  49. Giang Nguyen

    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

      Glad our recommendation could help you :)

      Admin

  50. Todd

    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

      Thanks for sharing what worked for you :)

      Admin

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.