Home/Blog/WordPress Fixes
WordPress Fixes

WordPress Login Keeps Redirecting? Fix the Login Loop (2026)

By Christy Sparks
Published Nov 14, 2026
11 min read

You type your password, click Log In, and the login page comes right back. No error. Your username is still there and the password box is empty. You try again, and again. Or you do get in, but WordPress drops you on your homepage instead of the dashboard.

This is a WordPress login redirect loop, and it is almost never a wrong password. We recreated the common causes on a test site and captured exactly what each one looks like, so you can match yours and fix it in the right order.

TL;DR

  • Your password is fine. The login cookie does not match the address WordPress sends you to.
  • Check the address bar after logging in. reauth=1 means a loop; the usual cause is a www/non-www or http/https mismatch.
  • Fastest fix when you are locked out: set WP_HOME and WP_SITEURL in wp-config.php.
  • Then rule out cookies and cache, plugins (rename the plugins folder), and an https setting such as Cloudflare Flexible SSL.

Get Emergency WordPress Help →

What a login loop looks like

WordPress login page shown again after a correct password, with the username filled in and no error message
After a correct password, the login page simply comes back: no error, username still filled in. The address bar shows wp-login.php?redirect_to=…&reauth=1. (Click to enlarge.)

On our test site, the business's WordPress Address used www and the Site Address did not. Here is what the browser did, every single time we logged in:

POST http://www.example-plumbing.test/wp-login.php          (password accepted, cookie set for www)
302 -> http://example-plumbing.test/wp-admin/                 (sent to the non-www address)
302 -> http://www.example-plumbing.test/wp-login.php?...&reauth=1   (no cookie there, so: log in again)

The cookie is set for one address and checked on the other, so WordPress keeps deciding you are logged out. Here are the causes in the order we check them.

1. Clear cookies for the site, or try a private window

Rule out the easy one first. Open a private or incognito window and log in there. If that works, delete the cookies for your site in your normal browser (not all your cookies, just this site's) and try again. Old cookies from before an https switch or a domain change are a classic cause. Also check your computer's clock is right: a badly wrong date can make cookies expire instantly.

2. Check the WordPress Address and Site Address

This is the most common cause. Both addresses must match the address you actually use, character for character: https or http, with or without www, and no trailing slash.

WordPress General Settings with WordPress Address set to www and Site Address without www
The cause of our loop: the WordPress Address has www, the Site Address does not. Settings > General. (Click to enlarge.)

If you can reach the dashboard (try logging in at the other version of the address, with or without www), fix both in Settings > General and save. If you cannot get in at all, set them in wp-config.php instead. Open it with your host's File Manager or SFTP and add these two lines just above the line that says That's all, stop editing!, using your real address:

define( 'WP_HOME', 'https://www.yourdomain.com' );
define( 'WP_SITEURL', 'https://www.yourdomain.com' );

These override the values in the database. On our test site, the very next login went straight to the dashboard. While they are in place, the two fields in Settings > General are greyed out:

WordPress General Settings with both address fields greyed out because they are set in wp-config.php
With WP_HOME and WP_SITEURL in wp-config.php, both fields are locked and match. (Click to enlarge.)

If you have WP-CLI, you can fix the database values directly instead:

wp option get home
wp option get siteurl
wp option update home 'https://www.yourdomain.com'
wp option update siteurl 'https://www.yourdomain.com'

Or in phpMyAdmin, look in the wp_options table (your prefix may differ) for the siteurl and home rows.

3. "Cookies are blocked due to unexpected output"

If you see this error instead of a silent loop, something printed text before WordPress could send its login cookies. Often it is a single blank line at the end of a file someone edited.

WordPress login error: Cookies are blocked due to unexpected output
We caused this with a tiny plugin that printed one blank line. One character is enough. (Click to enlarge.)

Check, in this order: anything you or a developer edited recently (wp-config.php, your theme's functions.php), then plugins. Look for a blank line or space before the opening <?php, or after a closing ?> at the end of a file. Deleting a closing ?> at the very end of a PHP file is safe and prevents this.

4. Rule out plugins and your theme

Security, login customizer, membership, caching, and redirect plugins can all interfere with login. If you cannot get into the dashboard to deactivate them, use your host's File Manager or SFTP and rename wp-content/plugins to plugins-off. WordPress treats every plugin as inactive. If login works, rename the folder back and reactivate plugins one at a time from the dashboard until the loop returns. The last one you turned on is the culprit.

If plugins are not it, do the same with your theme's folder in wp-content/themes. WordPress falls back to a default theme if one is installed.

Locked out by a security plugin specifically? See locked out by Wordfence.

5. Logged in, but sent to the homepage?

Sometimes the login works and WordPress takes you to the front of your site instead of the dashboard. Look for the black admin bar at the top. If it is there, you are logged in:

WordPress homepage with the admin bar showing Howdy, owner after login
Logged in, but on the homepage. The admin bar ("Howdy, owner") proves the login worked. We caused this with one line of plugin code. (Click to enlarge.)
  • Go straight to yourdomain.com/wp-admin/. If the dashboard opens, a plugin is choosing where people land after login. Check the redirect settings in your login, membership, or security plugin.
  • If /wp-admin/ also bounces you away, check your user role. Store and membership plugins often keep non-admin accounts out of the dashboard on purpose; WooCommerce, for example, sends customer accounts to the My Account page. Log in with an Administrator account.

6. https and "too many redirects"

If your browser says too many redirects, or the loop started right after adding an SSL certificate or Cloudflare, the problem is usually https:

  • Cloudflare Flexible SSL. Cloudflare serves visitors over https but talks to your server over http, so WordPress keeps redirecting to https. Set Cloudflare's SSL mode to Full (strict) with a valid certificate on your host.
  • A proxy or load balancer that ends https before your server. WordPress cannot see the visitor is on https. Your host can confirm, and the usual fix is this snippet in wp-config.php, above the stop-editing line:
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) {
    $_SERVER['HTTPS'] = 'on';
}
  • A redirect rule in .htaccess that forces www or https, fighting the addresses in WordPress. Make the rule and the two WordPress addresses agree.

7. Less common causes

CauseSignFix
COOKIE_DOMAIN set wrong in wp-config.phpStarted after a domain moveRemove the line or correct the domain
Page caching on the login pageCache, CDN, or host caching wp-login.phpExclude wp-login.php and /wp-admin/ from caching, then purge
Site was hackedStrange admin users, spam redirects, unknown filesTreat it as a hack: change passwords and get it cleaned

Still looping after all of this, or not comfortable editing wp-config.php? That is exactly what our emergency WordPress help is for. A login loop caused by one setting or plugin is usually our $175 Quick Fix, and we tell you the price before we touch anything.

Locked out of your own website?

Sparks Motion fixes WordPress login loops, redirects, and lockouts safely. We back up first, find the cause, and test that you and your customers can get in.

Get Emergency Help →

Frequently asked questions

Why does my WordPress login page keep refreshing without an error?

Your password was accepted, but the login cookie WordPress set does not match the address it sends you to next. The most common cause is the WordPress Address and Site Address not matching, for example one with www and one without, or one on http and one on https. WordPress logs you in on one address, sends you to the dashboard on the other, decides you are logged out there, and shows the login page again.

What does reauth=1 mean in the WordPress login address?

It means WordPress tried to show you the dashboard, could not find a valid login cookie for that address, and sent you back to log in again. Seeing reauth=1 after a correct password is the clearest sign of a login loop rather than a wrong password.

How do I fix the WordPress login loop if I cannot get into the dashboard?

Set the two addresses in wp-config.php. Add define( 'WP_HOME', 'https://yourdomain.com' ); and define( 'WP_SITEURL', 'https://yourdomain.com' ); above the line that says to stop editing, using your real address. They override the database and the loop usually stops immediately. Later, fix the values in Settings, General, and remove the two lines.

Why does WordPress redirect to the homepage after I log in?

Usually a plugin that controls where people go after login, such as a membership, login customizer, or security plugin, or WooCommerce sending customer accounts to the My Account page. If you are logged in, you will see the black admin bar at the top. Go straight to yourdomain.com/wp-admin/, and check the plugin's redirect settings or your user role.

What does "Cookies are blocked due to unexpected output" mean?

A plugin, theme, or edited file printed something, often a blank line or a stray space, before WordPress could send its login cookies, so the browser never received them. The fix is to find the file that outputs early: a recently edited functions.php or wp-config.php, or a plugin you just installed. Renaming the plugins folder tells you quickly whether a plugin is responsible.

Can Cloudflare cause a WordPress login loop?

Yes. If Cloudflare's SSL mode is Flexible, Cloudflare talks to your server over plain http while visitors use https, and WordPress can redirect back and forth endlessly, often with a too many redirects error. Switch the SSL mode to Full (strict) with a valid certificate on your host.

How much does it cost to have someone fix a WordPress login loop?

A login loop from one setting or plugin is usually our $175 Quick Fix, which covers diagnosis, the fix, and testing. If the loop is a sign of a hacked site, cleanup costs more, and we quote before we start.

How we tested this. Every screenshot and redirect in this guide came from a real WordPress 7.1.4 test site that we broke on purpose: mismatched WordPress and Site Addresses (the loop and the wp-config.php fix), a plugin printing one blank line (the cookies error), and a plugin rule sending logins to the homepage. The business in the screenshots is made up. Last reviewed Nov 14, 2026.

← Back to All Posts