A laptop displays a login screen surrounded by glowing circular arrows.

How to Fix a WordPress Redirect Loop

To fix a WordPress redirect loop, clear stale site cookies, correct conflicting URL settings, then investigate plugins and HTTPS configuration. A correct password followed by a silent return to login usually points to session or configuration trouble.

For a small business, that can leave your team locked out whilst clients encounter broken journeys. Start with reversible checks, then make one change at a time.

Key takeaways

  • A red password error usually means a credentials problem; a silent bounce suggests cookies, URLs or authentication settings.
  • You can repair URL settings and disable plugins without dashboard access.
  • Back up files and the database before editing configuration. Keep the last working backup separate, and retest after every change.

1. Rule out browser cookies and cached redirects

Identify the symptom

A WordPress login redirect loop returns you to the login form after a correct password. Common triggers include a rejected authentication cookie, mismatched addresses, plugin conflicts and HTTPS problems. The browser may reject the authentication cookie or fail to send it with the login request.

By contrast, ERR_TOO_MANY_REDIRECTS means the browser followed repeated redirects without reaching a page. That can affect the whole website, not only login.

Open the homepage and /wp-admin/ separately. Record the failure time and any recent migration, plugin update or SSL change.

Try a clean browser session

Open a private window or another browser. If login works there, remove the affected site’s cookies and try again.

When using the browser’s clear-data dialogue, select only Cookies and other site data. Leave history and saved passwords unticked. Removing cookies signs you out, so site-specific removal is preferable.

Next, clear cache in the browser, WordPress, hosting and CDN, working outwards in that order. Disabling a caching plugin doesn’t automatically remove cached redirects elsewhere.

A man in a blue hoodie shines a flashlight into a server rack.

2. Correct WordPress URL and cookie settings

Compare the addresses

If access works intermittently, open Settings > General. For a standard installation, WordPress Address and Site Address should match, including https and any www prefix.

However, WordPress installations deliberately stored in a subdirectory can have different addresses. Preserve that arrangement.

Without dashboard access, open phpMyAdmin through your hosting panel. Select the database named by DB_NAME in wp-config.php, then find siteurl and home in wp_options. The table prefix may differ.

Record the original values before correcting unintended protocol, hostname or path differences. After a move, our WordPress migration checklist covers related URL risks.

Override incorrect values without logging in

Use SFTP or your hosting File Manager to download a backup of wp-config.php. Above its stop-editing comment, add these settings, substituting your actual addresses:

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

Edit existing definitions rather than duplicating them. Use no trailing slash.

WP_HOME and WP_SITEURL both override database values immediately, as explained in WordPress’s configuration documentation. The corresponding Settings fields become read-only until you remove them; the database values remain unchanged. If you later remove either constant, check the underlying home and siteurl records in wp_options first.

Also inspect any custom COOKIE_DOMAIN. A stale hostname or incorrect subdomain scope can prevent authentication. A leading dot isn’t universally required by modern browsers, so don’t add one blindly. For an ordinary single-site installation, remove an unnecessary or obsolete COOKIE_DOMAIN definition, or correct its hostname if it scopes the authentication cookie incorrectly. Removing an unnecessary override allows WordPress to choose its defaults.

3. Isolate conflicting plugins and themes

Disable plugins without deleting their data

First record active plugins. On staging, disconnect email marketing and lead-generation automations so tests don’t contact real clients.

Without dashboard access, use SFTP or cPanel File Manager to rename the plugins folder (/wp-content/plugins/) to plugins-old. Create a new, empty plugins directory, then retry login.

If access returns, visit Plugins whilst the original folder remains renamed. WordPress will recognise the missing plugins as inactive.

Remove the empty directory, rename plugins-old back to the plugins folder, then reactivate plugins individually. Test login after each activation, starting with parent plugins before dependent add-ons.

Security, redirection, caching and custom-login plugins deserve particular attention. A login-customisation plugin such as WP Adminify may change the configured login path, so record the login URL before deactivating it. Must-use plugins and cache drop-ins require separate investigation.

Test an installed default theme

If plugins aren’t responsible, temporarily activate an installed default theme such as Twenty Twenty-Five. Don’t delete your existing themes.

With SSH and WP-CLI available, wp theme activate twentytwentyfive can switch an installed copy without dashboard access.

A theme change can affect web design, navigation and digital branding, so use staging where practical. If the fault followed custom web development, roll back the relevant change through your normal deployment process.

4. Repair damaged .htaccess rules

On Apache, a damaged .htaccess file can interfere with WordPress routing. Enable hidden files in your file manager, download a copy, and preserve custom redirects and security directives.

Briefly rename it to .htaccess.bak, then retest login. This temporarily removes its protections, so keep the test controlled.

If access returns, open Settings > Permalinks and save without changing the structure. On a writable Apache installation, WordPress regenerates its default rules.

If restoring manually, replace only the damaged WordPress block bounded by # BEGIN WordPress and # END WordPress using a known-good backup. Don’t discard unrelated rules.

Multisite needs different rules, covered in the WordPress network setup instructions. Nginx doesn’t use .htaccess, so this file-based fix doesn’t apply there.

5. Fix HTTPS and Cloudflare configuration

Replace Flexible SSL with Full (strict)

Cloudflare’s Flexible SSL mode encrypts the browser-to-Cloudflare connection, but contacts your origin over plain HTTP. If WordPress then insists on HTTPS, the same request can repeat indefinitely.

That mismatch commonly produces ERR_TOO_MANY_REDIRECTS. Cloudflare’s Flexible mode guidance explains this behaviour.

Install a valid certificate at the origin, such as a publicly trusted certificate or Cloudflare Origin CA certificate. Confirm it’s active in SSL/TLS, then select SSL/TLS > Overview > Full (strict) and purge cached redirects.

Full (strict) encrypts the origin connection and validates its certificate. Don’t switch before the origin is ready.

A glass cloud sculpture with glowing circuits connected by cables to a server rack.

Recognise HTTPS behind a trusted proxy

A load balancer or reverse proxy may terminate TLS before forwarding requests to WordPress. If WordPress then sees HTTP, it can generate repeated HTTPS redirects.

Only when your trusted proxy supplies and controls X-Forwarded-Proto, the following belongs in wp-config.php before WordPress loads:

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

Don’t paste this onto an ordinary single-server setup. It doesn’t repair mixed-content resources, and trusting an uncontrolled header creates risk.

If Cloudflare is already configured correctly, its redirect-loop troubleshooting guidance distinguishes other conflicting HTTPS rules.

6. Investigate persistent authentication failures

Replace all eight security salts

If correct credentials still produce a silent bounce after URL and cookie repairs, regenerate the authentication keys and salts.

Get a fresh block from the WordPress security-key generator and replace the entire block of eight define() lines in wp-config.php.

Avoid duplicate definitions or incomplete edits. Where several application servers share the site, keep their keys consistent.

This change invalidates existing login cookies and logs out every user. Tell colleagues first, then clear the site’s browser cookies and sign in again.

Enable private diagnostic logging

Back up wp-config.php, then edit existing definitions or add missing ones above the stop-editing comment:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', '0');

Reproduce the failure once and inspect /wp-content/debug.log. Check the relevant timestamped entry in debug.log, then match file paths and stack traces to that attempt. An unrelated plugin warning doesn’t establish the cause.

However, ordinary redirects may create no PHP error. In browser developer tools, open Network, preserve the log, and inspect repeated requests and their Location response headers. Alternating HTTP/HTTPS or www/non-www destinations reveal the conflicting addresses.

An empty debug log doesn’t rule out a redirect loop. Successful redirect responses aren’t necessarily PHP errors.

Keep logs access-restricted. Afterwards, disable debugging and securely remove diagnostic files you no longer need.

7. Confirm recovery beyond the dashboard

Log out, sign back in, then open an internal page and submit a test enquiry. Also test a mobile-responsive journey rather than relying on a cached homepage.

Follow actual links from social media, email campaigns and your Google Business Profile. Those entry points matter for local SEO and conversion optimisation.

For agencies, confirm that forms still reach the intended systems and automation. Include any AI-assisted small-business workflows that process enquiries, but prevent test submissions triggering real customer messages.

Finally, record the cause, repair and rollback route in your website support and maintenance plan. Website care and maintenance should cover login checks and recovery testing, alongside updates.

If the symptom changes to a server error, follow our WordPress 500 error troubleshooting rather than continuing to change authentication settings.

Frequently asked questions

Why does wp-admin redirect to the homepage?

A membership, security or redirection plugin may send certain users away from administration. Some plugins also hide login URL paths. Custom code in functions.php or a must-use plugin can do the same with wp_redirect.

If wp-admin redirects to homepage after a successful login, that’s different from an endless loop. Check role-based restrictions and any redirect rule targeting the homepage slug before removing them, as they may protect administration access intentionally.

Can I fix the loop without losing content?

Yes. Clearing cookies, correcting URLs and temporarily disabling plugins normally preserve posts and uploads. Avoid deleting plugins, running uninstall routines or replacing the database as an early troubleshooting step.

If a restore becomes necessary, preserve newer orders, bookings and enquiries first. Restoring an older database can overwrite records created since that backup.

Restore access with a controlled fix

A WordPress redirect loop is easier to resolve when each change answers a specific question. Start with cookies and URLs, then isolate extensions and HTTPS configuration.

Treat recovery as complete only when login and real customer journeys both work.

If your agency needs a technical partner for website builds, web hosting and ongoing support, See how we collaborate with creative agencies.

Leave a Reply

Your email address will not be published. Required fields are marked *