Skip to content
WordPress3 min read

WordPress keeps sending you back to the login page: how to fix it

wp-login.php?redirect_to=...&reauth=1

Short answer

A WordPress login loop happens when the login succeeds but the browser doesn't keep the auth cookie, or sends it to a different address, so WordPress returns you to wp-login.php. The usual causes are a site URL mismatch between http and https or www and non-www, caching, a security plugin, or a wrong SSL mode in Cloudflare.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Common causes
  2. How to fix it
  3. Prevention
  4. On ArabyHost

When you log in, WordPress sets an auth cookie in the browser and sends you to /wp-admin. If the cookie isn’t there when the dashboard loads, you’re bounced to wp-login.php?redirect_to=...&reauth=1 and the cycle repeats without any error. Sometimes you’ll see Cookies are blocked or not supported by your browser, and sometimes it turns into ERR_TOO_MANY_REDIRECTS.

Common causes

  • A site URL mismatch: the setting says https://example.com while you log in via http:// or www.example.com, so the cookie is saved for one host and requested from another.
  • Cloudflare SSL set to Flexible, so WordPress doesn’t know the connection is HTTPS.
  • A cache storing the login page or dashboard.
  • A security or redirect plugin changing the login path or rejecting the session.
  • Stale or blocked cookies in the browser.
  • A wrong COOKIE_DOMAIN line in wp-config.php left over from a migration.
  • Conflicting redirect rules in .htaccess.

How to fix it

1. Clear cookies and try a private window

Clear the site’s cookies, or open a private window, and log in using exactly the address configured for the site.

2. Check the site URL

In cPanel open Databases » phpMyAdmin, then the wp_options table (your prefix may differ), and check siteurl and home. They must match each other and the form you actually use, e.g. https://example.com with no trailing slash. Or pin them in wp-config.php via Files » File Manager:

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

3. Fix HTTPS behind a proxy

If the site is behind Cloudflare, set SSL mode to Full (strict) as in the Cloudflare with hosting guide. If you can’t change that right now, add this to wp-config.php above That's all, stop editing!:

if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) {
    $_SERVER['HTTPS'] = 'on';
}

4. Disable plugins temporarily

In File Manager rename wp-content/plugins to plugins-off and try logging in. If it works, rename it back and disable plugins one by one, starting with security, redirect and caching plugins.

5. Review wp-config.php and .htaccess

Remove any define( 'COOKIE_DOMAIN', ... ) line you didn’t add on purpose. Then reset .htaccess to the default WordPress rules between # BEGIN WordPress and # END WordPress, and remove duplicate HTTPS or www redirects.

6. Exclude login from the cache

Make sure your caching plugin or Cloudflare doesn’t cache wp-login.php or /wp-admin, then purge everything.

Prevention

  • Pick one canonical address (with or without www, always https) and 301-redirect everything else to it once.
  • After a migration or enabling SSL, update siteurl and home right away.
  • Don’t run more than one plugin that controls redirects or the login page. For more, see the secure WordPress guide.

On ArabyHost

A free SSL certificate is issued automatically through AutoSSL, so set the site address to https:// from the start. phpMyAdmin and File Manager are in cPanel, which opens with one click from the Araby Panel, and LiteSpeed Cache doesn’t cache dashboard pages by default. If the problem remains, the Araby AI assistant reads the error logs, and our Arabic-speaking support can review the settings with you.

FAQ

What does reauth=1 in the login URL mean?

It means WordPress asked you to log in again because it found no valid auth cookie when you opened the dashboard. Seeing it after every attempt shows the cookie isn't being saved or isn't sent to the right address.

How do I get in if I've also forgotten the password?

You can reset it in phpMyAdmin by editing user_pass in the wp_users table and choosing the MD5 function; WordPress upgrades it to a stronger hash on first login. Fix the loop first, though, since a correct password alone won't help.

Can Cloudflare cause a login loop?

Yes, if its SSL mode is Flexible: the server receives plain HTTP while the visitor sees HTTPS. Switch to Full (strict) once the server has a certificate.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.