Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting · Troubleshooting

How to Fix a Cloudflare Redirect Loop on WordPress

Short answer

A Cloudflare redirect loop on WordPress usually comes from Flexible SSL mode clashing with a server that redirects HTTP to HTTPS. Cloudflare asks the origin over plain HTTP, the origin redirects to HTTPS, and the cycle repeats. Fix it by putting a valid certificate on the origin, switching Cloudflare to Full (strict), and making both WordPress addresses use the same HTTPS URL.

Key takeaways

  • Flexible SSL sends plain HTTP to your origin, so any origin HTTPS redirect creates a loop.
  • Full (strict) encrypts the Cloudflare to origin connection and checks the origin certificate.
  • Both WordPress addresses must use the same HTTPS URL, with no trailing slash.
  • Force HTTPS in one place only, either at Cloudflare or at the origin, not both.
  • Purge the Cloudflare cache and test in a private window after each fix.

What does ERR_TOO_MANY_REDIRECTS mean?

A redirect loop means the browser is sent from one address to another, then back again, until it stops and shows an error.

A redirect is a 3xx response with a Location header that tells the browser to request a different URL, as MDN explains in its guide to HTTP redirections.

A normal redirect ends at a page with a 200 response. A loop never ends, so the browser gives up instead of loading the page.

Chrome shows this as ERR_TOO_MANY_REDIRECTS. Firefox words it as “The page isn't redirecting properly.”

The error is a site setting problem, not a visitor problem. If the loop hits every browser and every device, the fix sits on the server or in Cloudflare.

Why does Cloudflare Flexible SSL cause a redirect loop?

Flexible SSL causes a loop when your origin server redirects HTTP to HTTPS, because Cloudflare keeps asking the origin over plain HTTP.

Cloudflare sits between visitors and your origin server. Its SSL/TLS encryption mode controls both connections, as Cloudflare explains in its encryption modes guide.

In Flexible mode, traffic from visitors to Cloudflare can use HTTPS, but traffic from Cloudflare to the origin is not encrypted. The origin sees an HTTP request and redirects it to HTTPS.

Cloudflare passes that redirect to the browser. The browser asks again over HTTPS, Cloudflare asks the origin over HTTP again, and the cycle repeats.

Cloudflare's troubleshooting page for this error lists encryption mode as a common cause, updated 1 September 2026. It says loops occur when the mode conflicts with the origin server settings.

How do you trace the redirect loop before changing anything?

Trace the loop with curl first, so you change the setting that is actually sending visitors in circles.

Run this command from a terminal, with your own domain in place of example.com:

curl -sIL --max-redirs 10 https://example.com/

Look at the HTTP status lines and the Location headers. A Flexible SSL loop shows the same HTTPS address repeating, hop after hop.

If the address changes between hops, you have a different loop. Note the two addresses that alternate, because they name the two rules that disagree.

Also check whether only wp-admin loops, or the whole site loops. A loop limited to wp-admin points at WordPress HTTPS detection, covered later in this guide.

What you seeLikely causeWhere to fix it
Same HTTPS address repeatsFlexible SSL plus origin HTTPS redirectCloudflare SSL/TLS mode
HTTP and HTTPS addresses alternateWordPress address uses HTTP while the server forces HTTPSSettings > General or wp-config.php
www and non-www addresses alternateWordPress address and server rule disagree on wwwWordPress addresses and redirect rules
Only wp-admin loopsWordPress cannot see HTTPS behind a proxywp-config.php proxy check

How do you switch Cloudflare to Full (strict)?

Switch Cloudflare to Full (strict) after you have a valid certificate on the origin server, because that mode encrypts the second connection and checks the certificate.

First, confirm the origin has a valid certificate. Most hosts install a free certificate for you, and our guide to Cloudflare SSL settings for WordPress walks through the related settings.

Cloudflare strongly recommends Full or Full (strict) to prevent malicious connections to the origin, as of November 2026. Full matches the visitor protocol but does not check the origin certificate.

Full (strict) adds that check. The certificate can come from a public authority such as Let's Encrypt, or from Cloudflare Origin CA, according to Cloudflare's encryption modes guide.

Follow these steps in the Cloudflare dashboard:

  1. Open your domain, then go to SSL/TLS > Overview.
  2. Choose Full (strict) as the encryption mode.
  3. Wait about 1 minute, then run the curl trace again.

A fixed site shows one 301 redirect at most, then a 200 response. If you switch before the origin certificate is valid, the loop turns into an SSL error instead, so check the certificate first.

How do you fix the WordPress Address and Site Address?

Set both WordPress addresses to the same HTTPS URL, with the same www choice and no trailing slash.

WordPress stores two addresses in Settings > General. The Site Address is the address people type to reach the site, and the WordPress Address is where the core files live.

WordPress.org says both settings should include the https:// part and should not have a slash at the end, in its guide to changing the site URL.

If one address uses http and the other uses https, WordPress and the server keep sending visitors back and forth. The same happens when one uses www and the other does not.

If you can reach the dashboard, open Settings > General, set both fields to the same HTTPS address, and save. If the loop locks you out, set them in wp-config.php instead:

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

Add those lines above the line that says “That's all, stop editing!” WordPress.org notes that hard-coded values cannot be edited on the General settings page while the lines are present.

How do you tell WordPress about HTTPS behind a proxy?

Add a short check to wp-config.php that reads the X-Forwarded-Proto header, so WordPress knows the visitor used HTTPS even when the proxy talks HTTP to the origin.

This step matters when only wp-admin loops, or when the site sits behind a proxy that ends the HTTPS connection. WordPress checks its own connection to decide if a request is secure.

Behind a proxy, that connection is plain HTTP, even though the visitor used HTTPS. WordPress then redirects to HTTPS, the proxy sends HTTP again, and the loop repeats.

Add these lines to wp-config.php, above the line that says “That's all, stop editing!”:

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

Use this check only when every visit reaches your server through a proxy you control, such as Cloudflare. A header sent straight to a public origin can be faked.

With Full (strict) mode, the origin already receives HTTPS itself, so this check is often not needed. Try the mode change first, then add this check if wp-admin still loops.

How do you check Always Use HTTPS, HSTS and redirect rules?

Force HTTPS in one place only, because two HTTPS rules that disagree will keep the loop alive after you fix the SSL mode.

Cloudflare's Always Use HTTPS page says the setting redirects all http requests to https for all subdomains and hosts. It also says Cloudflare recommends not performing redirects at the origin, as this can cause redirect loop errors.

Turn it on in the dashboard under SSL/TLS > Edge Certificates, then remove the matching redirect from the origin. Keep one HTTPS rule, not two.

HSTS is a second edge setting to check. Cloudflare says HSTS directs browsers to transform http links to https links, and a loop can follow if the origin redirects HTTPS back to HTTP.

Redirect rules are the third place to check. Cloudflare says loops can occur with conflicting URL redirects, so review redirect rules and Page Rules and remove any pair that points at each other.

SettingWhere it livesLoop risk
Always Use HTTPSSSL/TLS > Edge CertificatesHigh if the origin also redirects to HTTPS
HSTSSSL/TLS > Edge CertificatesHigh if the origin redirects HTTPS to HTTP
Redirect rulesRules > Redirect RulesHigh if two rules point at each other
Page RulesRules > Page RulesHigh if an old rule still forces a different address

How do you clear cache and check the fix worked?

Purge the Cloudflare cache and test in a private window, because a cached redirect can keep looping after the setting is fixed.

Cloudflare strongly recommends single-file purging by URL instead of a full purge, according to its purge cache guide, updated 29 September 2026.

To purge one page, go to Caching > Configuration > Purge Cache, choose Custom Purge, enter the page URL, and purge it. Use Purge Everything only when many pages are affected.

After a full purge, the next request for each resource returns a CF-Cache-Status header of MISS, which means Cloudflare fetched a fresh copy from the origin.

Then check the fix in this order:

  1. Run the curl trace again and look for a single redirect, then a 200 response.
  2. Open the home page in a private window, with cookies cleared for that domain.
  3. Open wp-admin and log in, then open 2 or 3 inner pages.

If the home page loads but wp-admin still loops, go back to the proxy check in wp-config.php. If nothing loads, re-check the origin certificate and the SSL mode.

When should you contact your host?

Contact your host when the origin has no valid certificate, when you cannot reach wp-config.php, or when the loop continues after Cloudflare is set to Full (strict).

Your host can install or renew the origin certificate, and can confirm whether the server forces HTTPS or HTTP. Ask them which redirect rules run on the server before WordPress loads.

Ask them to check the server error log for the redirect chain, and to confirm the site loads when Cloudflare is paused. Pausing Cloudflare tests whether the loop lives at the origin or at the edge.

Give the host the curl output, the SSL mode you set, and the time the loop started. A loop that started right after an SSL install or a host change is usually a server redirect, not a WordPress bug.

If the host says the origin is fine and the loop only happens through Cloudflare, return to the redirect rules and the Always Use HTTPS setting. One of those two is the usual leftover cause.

For background on the wider setup, see how to set up Cloudflare for WordPress.

If the error changes to a 500 error after your fix, see our guide on how to fix the 500 error.

Certificate costs are covered in how much an SSL certificate costs.

Let's Encrypt vs paid SSL compares certificate options.

What mistakes should you avoid?

Do not stack a second HTTPS redirect on top of the first one, and do not switch modes before the origin certificate is ready.

Switching to Full (strict) with no valid origin certificate swaps the loop for an SSL error. Check the certificate first, then change the mode.

Do not leave Flexible mode in place and add the wp-config.php proxy check as a permanent fix. That check hides the loop while the Cloudflare to origin connection stays unencrypted.

Do not edit both WordPress addresses to different values, and do not leave a trailing slash on either one. WordPress.org says both should use https:// and no trailing slash.

Do not test only with a normal browser reload. Cached 301 redirects can survive a fix, so test in a private window and with curl before you call the job done.

Frequently asked questions

How long does a Cloudflare redirect loop take to fix?

Most loops clear in under 30 minutes once you find the cause. Changing the SSL mode takes about 1 minute to apply, and a cache purge takes a few minutes more. The slow part is tracing the loop first, because guessing at settings can add new redirects. Test with curl after each single change so you know which change fixed it.

Can I just turn off Always Use HTTPS to stop the loop?

Turning it off can stop one kind of loop, but it leaves HTTP versions of your pages reachable. A better fix is to keep Always Use HTTPS on and remove the matching redirect at the origin, so only Cloudflare forces HTTPS. If the origin must keep its own redirect, then turn Always Use HTTPS off and keep the origin rule only.

Why does my site loop only after I add Cloudflare?

Adding Cloudflare changes how requests reach the origin. In Flexible mode Cloudflare talks HTTP to the origin, while your origin may already redirect HTTP to HTTPS. Before Cloudflare, visitors talked to the origin directly and the redirect worked once. After Cloudflare, the same redirect repeats on every request because the origin never sees HTTPS.

Will switching to Full (strict) break my site?

It will break the site only if the origin certificate is missing, expired, or for a different hostname. In that case visitors see an SSL error instead of the loop. Check the origin certificate first, install or renew it through your host if needed, then switch the mode. With a valid certificate in place, the switch is safe.

Do I need a plugin to fix a Cloudflare redirect loop?

No plugin is needed for the usual cause. The fix is a Cloudflare SSL mode change, matching WordPress addresses, and one HTTPS redirect rule. An SSL plugin can help set the WordPress addresses, but it can also add a second HTTPS redirect that keeps the loop going. If you use one, turn off its redirect when Cloudflare already forces HTTPS.

Sources

  1. ERR_TOO_MANY_REDIRECTS Cloudflare SSL/TLS docs
  2. Encryption modes Cloudflare SSL/TLS docs
  3. Always Use HTTPS Cloudflare SSL/TLS docs
  4. Changing the Site URL WordPress.org Documentation
  5. Redirections in HTTP MDN Web Docs
  6. Purge everything Cloudflare Cache docs
  7. RFC 9110: HTTP Semantics RFC Editor

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test