Black FridayCyber Monday 2026
14Days
15Hrs
34Mins
42Secs
Flat20% OFF

Our biggest sale of the year20% off the first payment on all maintenance plans. Code BF2026

Grab the deal
WordPress

WordPress Login Redirect Loop: Fix Being Sent Back to wp-login

You type the right password and WordPress sends you back to the login page. The cause is usually cookies, address settings, caching or a plugin.

wpallsolution Updated 7 min read

A WordPress login redirect loop is the moment you enter the correct username and password, the page reloads, and you are on the login screen again, sometimes with a URL that keeps growing. WordPress is not rejecting your password. It is failing to keep you logged in, because the login cookie is not accepted, the addresses it uses do not agree, or a cache or plugin is interfering. This guide tests those causes in order, starting with the cheapest.

Quick answer

First try a private window with cookies allowed, to rule out your browser. Then check that the WordPress Address and Site Address are identical, including https and www. If the login screen mentions cookies or unexpected output, look for stray characters in PHP files such as wp-config.php. Make sure wp-login.php and /wp-admin/ are not cached, and finally test with all plugins and a default theme. Keep a backup and change one thing at a time.

How this guide was prepared: it is research-based. We read the WordPress login code and the WordPress documentation listed under Sources, checked on October 23, 2026. We did not reproduce a loop on a live host, and the cause on your site may be a combination of the points below.

How WordPress logs you in

When you submit the login form, WordPress checks your password and sets authentication cookies in your browser; later requests to the admin area use those cookies to know who you are. WordPress also sets a test cookie before login. Its login code shows two related messages: “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” when the test cookie is missing, and “Cookies are blocked due to unexpected output.” when something printed output before the cookies could be sent. If neither message appears but you still loop, the cookie may be set for one address (for example without www) and then sent to another, or a cache may be answering the request instead of WordPress.

The decision tree: why does login send you back?

Flowchart for a WordPress login redirect loop: five questions about the browser, site addresses, cookie errors, caching and plugins
Five questions point to cookies, addresses, caching or plugins.
  1. Fails in a private window with cookies allowed? The cause is on the site (Step 1).
  2. WordPress and Site addresses do not match? Make them identical (Step 2).
  3. Login screen mentions cookies or unexpected output? Look for stray output (Step 3).
  4. wp-login.php or wp-admin cached? Exclude them (Step 4).
  5. Started after a plugin or theme change? Test with plugins off (Step 5).

Symptoms and likely causes

What you seeLikely causeStart with
Works in another browser or deviceOld cookies or a browser extension in the first browserStep 1
Loop started after enabling HTTPS or adding or removing wwwAddress settings or redirects disagreeStep 2
Message about cookies or unexpected outputCookies blocked, or stray output before headersSteps 1 and 3
Login worked until you switched on cachingA cache is serving the login or admin requestStep 4
Started after a plugin or theme updateA security, login or caching plugin conflictStep 5

5 steps to fix a WordPress login redirect loop

Step 1: Rule out your browser

Open the login page in a private window with cookies allowed, or in a different browser or device. If it works there, clear the cookies and cache for your site in the first browser and disable extensions that block cookies. WordPress’s cookie documentation explains how to enable cookies in a browser.

Step 2: Make the WordPress and Site addresses match

Check Settings → General, or the values with wp option get home and wp option get siteurl. Both should use the same scheme and host, with https:// if you use HTTPS and no trailing slash. The WordPress developer documentation also describes setting WP_HOME and WP_SITEURL in wp-config.php. A mismatch between www and non-www makes the cookie belong to one host while you are on the other. The redirect side of this is covered in ERR_TOO_MANY_REDIRECTS in WordPress.

Step 3: Look for stray output before the headers

If the login screen shows “Cookies are blocked due to unexpected output”, something printed text, a space or a byte order mark before WordPress sent its cookies. The WordPress FAQ explains that this usually comes from blank lines or characters before an opening <?php tag or after a closing ?> tag, typically in wp-config.php or another edited PHP file, and that a file saved as UTF-8 with BOM can cause it. Check the file named in any “headers already sent” warning, save it as plain UTF-8 without BOM, or restore a clean copy.

Step 4: Keep login and admin out of the cache

Page caches, server caches and CDNs should never cache wp-login.php, /wp-admin/ or pages for logged-in users. Check your caching plugin and your host’s or CDN’s rules, clear all caches, and test again. Be careful with rules that cache by cookie.

Step 5: Test plugins and the theme

If it started after a change, deactivate plugins. When you cannot reach the admin, the WordPress FAQ describes two methods: rename the plugins folder under wp-content (for example to plugins.hold) and log in, then rename it back and reactivate plugins one by one; or set the active_plugins option to a:0:{} in the database. Security, two-factor, login URL and caching plugins are the usual suspects. Our guide on finding the plugin that broke your site shows a safe order, and WordPress plugin conflict explains how to test. If a default theme fixes it, the theme is the cause.

Version and hosting differences

  • Some hosts add their own cache or security layer in front of WordPress that can affect login; ask your host if the steps do not help.
  • Multisite uses its own cookie and address settings, so check the network settings too.
  • Custom login URLs from plugins add one more place where redirects may go wrong.

How to verify the fix

  • You can log in, reach the dashboard and stay logged in after reloading.
  • It works in a private window and a second browser.
  • You can log out and log in again from both the www and non-www address.

How to prevent it from happening again

  • Back up before changing address, HTTPS, caching or security settings.
  • Test login after plugin and hosting changes.
  • Keep one preferred address and keep caches away from login and admin.

Frequently asked questions

Is my password wrong?

No. A wrong password shows an error. A loop means the login succeeded but the session was not kept.

Can a plugin cause it?

Yes, especially security, login and caching plugins. Test with plugins off.

Does clearing cookies always fix it?

Only when the problem is in your browser. If a private window also loops, the cause is on the site.

Is it safe to edit wp-config.php?

What to do next

Rule out the browser, match the addresses, check output and caches, then test plugins. If you are locked out and need the site back, wpallsolution offers an emergency WordPress fix and plugin support. We cannot promise a result without seeing your setup.

Sources and official documentation

Keep reading

More guides

Need a hand with this?

Tell us what is happening. We reply with honest next steps.

Talk to us