Stuck in an infinite loop when trying to log in to my wordpress site. I type in the URL/wp-admin and then it loops me back to the regular website, not the admin login page.

I have tried with http and https to no luck...

  • take backup & Delete .htaccess File
    – Ravi Patel
    Feb 27, 2018 at 8:48

5 Answers 5


I found a solution. In wp-config.php add:

define('FORCE_SSL_ADMIN', false);

In my situation, I migrated to https from http, and use plugin Rename wp-login.php

My wp-config.php contained the lines:


Without the line define('FORCE_SSL_ADMIN', false);, a redirect loop occurs.

  • 5
    Thanks. This fixed the issue for me as well. I think using Cloudflare also plays a part in causing this redirect loop. May 10, 2018 at 4:49
  • 7
    In theory you never want admins to be logging in over an insecure connection, so turning off FORCE_SSL_ADMIN is usually a bad idea.
    – user45623
    Aug 3, 2018 at 1:01
  • 1
    This did not help.
    – haxpanel
    Mar 19, 2019 at 13:33
  • This was helpful to be able to stop the redirect in order to log into the WP-Admin and correct the site url there as needed. Thanks!
    – OG Sean
    Apr 11, 2020 at 3:41
  • 1
    Additionally when using CloudFlare Flexible SSL, check this out community.cloudflare.com/t/endless-redirect-with-wordpress/3914/…
    – Arie
    Apr 9, 2022 at 22:03

Don't worry, you'll be back in quick if you follow these steps one at a time, until one succeeds!

  1. Clear you cookies - Clear your local browser cookies (follow instructions for whatever browser you are using.
  2. Deactivate All Plugins - Rename /wp-content/plugins/ directory to plugins_OLD
  3. Revert Back to the Default Theme - Go to /wp-content/themes/ directory and rename your current theme directory to anything (like theme_OLD).
  4. "Delete" .htaccess File - Again using FTP software, rename this to .htaccess_OLD
  5. Update Site URL - In wp-config.php add these lines (using your url of course):

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

  • 2
    I found the same instructions elsewhere on web, but skipped #5 because it seemed too simple. Step #5 solved my problem on localhost.
    – MTAdmin
    Aug 18, 2018 at 14:22

I've just solved an issue with this symptom. The 8 key and salt values must be present in the wp-config.php file or admin doesn't work.

I had these in the file, but because of how I dynamically generated wp-config.php the values were appended at the bottom of the file. Any constant definitions (define()) must be placed above the /* That's all, stop editing! Happy blogging. */ line.

Wordpress gave no error or logs to indicate it was missing config items. This also stopped 'WP_DEBUG', true working. Once I moved all of these higher in the wp-config.php file everything started working.


I spend hours trying to resolve this, did everything. Eventually notice a log about group write permissions on the wp-login.php file. Looked and the server file permissions were 664 .. changed them to 644 and problem solved.


I had the same issue after moving my site from a production host to localhost for dev testing. Steps that work for me in production didn't work locally. For instance, when using Chrome as my browser, entering

http://localhost/wp/wp-admin would redirect to


Entering my username/password would redirect back to the second link with a new username/password prompt.

Firefox resolution: add to wp-config.php:


Chrome resolution: Remove the redirect querystring from the login page: e.g. http://localhost/wp/wp-login.php .

Yes, I'm fairly new to Wordpress and I'm not 100% certain of the internal route for logins and redirects after authentication, so much trial and error was involved to find these two solutions. Hopefully they can help someone else.

Not the answer you're looking for? Browse other questions tagged or ask your own question.