If your WordPress site suddenly shows a “ERR_TOO_MANY_REDIRECTS” or “This page isn’t working” message right after you turn on Cloudflare, you’re dealing with a redirect loop. This happens when Cloudflare and your server keep sending the request back and forth because of mismatched HTTPS or caching settings. This guide walks you through the exact steps to break the loop and get your site loading again, usually within a few minutes.
What You’ll Need
- Access to your WordPress admin dashboard (or FTP/cPanel if you can’t log in)
- Your Cloudflare account login
- Access to your hosting control panel or file manager
- A basic text editor (like Notepad or TextEdit) if editing files
Step-by-Step
- Log in to Cloudflare and check your SSL/TLS encryption mode. Go to the domain in your Cloudflare dashboard, click SSL/TLS in the left menu, then Overview. Under SSL/TLS Encryption Mode, select Full (strict) if your server has a valid SSL certificate. If you’re not sure, try Full first. Do not use Flexible unless your server has no SSL at all—Flexible is the most common cause of redirect loops because Cloudflare connects to your server over HTTP while your site forces HTTPS.
- Check your WordPress address and site address. Log in to your WordPress admin (if you can). Go to Settings → General. Both WordPress Address (URL) and Site Address (URL) must start with https:// (including your domain). If they show http://, change them to https:// and save. If you can’t access the admin, you’ll need to edit wp-config.php (next step).
- Add a redirect rule to wp-config.php. Using FTP or your hosting file manager, open wp-config.php in the root of your WordPress installation. Add the following lines just before the line that says
/* That's all, stop editing! Happy publishing. */:define('FORCE_SSL_ADMIN', true); if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) { $_SERVER['HTTPS'] = 'on'; $_SERVER['SERVER_PORT'] = '443'; }This tells WordPress to trust the HTTPS header that Cloudflare sends, which stops the loop. Save the file and refresh your site.
- Clear Cloudflare cache. In your Cloudflare dashboard, click Caching in the left menu, then Configuration. Click the Purge Everything button. This removes any cached version of your site that might be stuck in the loop.
- Clear your browser cache and cookies. After purging Cloudflare, clear your browser’s cache and cookies for your domain. You can also try an incognito/private window to test without cache.
- If the loop persists, temporarily disable Cloudflare proxy. In Cloudflare’s DNS settings, find the A record for your domain (and www). Click the orange cloud icon to turn it gray (DNS only). This bypasses Cloudflare’s proxy and lets you access your site directly. If your site loads fine now, the issue is definitely with Cloudflare’s settings. Re-enable the proxy after fixing the SSL settings.
- Check for conflicting redirect plugins. If you have a redirect plugin (like Redirection or Really Simple SSL), it might be forcing an HTTPS redirect that conflicts with Cloudflare. Deactivate all redirect plugins temporarily via the WordPress admin or by renaming the plugin folder via FTP. If the site loads, reactivate them one by one to find the culprit.
Common Mistakes
- Using Flexible SSL when your server has SSL. This is the #1 cause. Flexible makes Cloudflare connect to your server over HTTP, but if your WordPress or server forces HTTPS, it creates a loop.
- Forgetting to update the site URL in the database. If you changed to HTTPS but the site URL still has http, WordPress will keep redirecting. Always check both URLs in Settings → General.
- Not clearing cache after changing settings. Cloudflare and your browser may hold onto the old redirect rules. Always purge after any change.
- Adding multiple redirect rules. If you have .htaccess redirects, wp-config rules, and a plugin all forcing HTTPS, they can conflict. Keep only one method.
Tips
- Use Full (strict) if your SSL certificate is valid and covers your domain (including www). It’s the most secure and prevents many issues.
- If you use a CDN or caching plugin (like W3 Total Cache or WP Super Cache), clear its cache as well after making changes.
- Test your site using an online redirect checker to see the exact path of redirects. This helps identify where the loop occurs.
- Keep a backup of your wp-config.php before editing, so you can revert if something goes wrong.
Troubleshooting
If the loop still isn’t fixed after trying the steps above, here are additional things to check:
- Check your .htaccess file. Look for any redirect rules that might be forcing HTTP to HTTPS or vice versa. A common issue is a rule that redirects all traffic to https, but Cloudflare is sending HTTP. Remove any conflicting rules or add a condition to exclude Cloudflare’s IPs.
- Check your server’s SSL configuration. If you’re using a self-signed certificate, Full (strict) will fail. Use Full instead, or get a valid certificate from Let’s Encrypt (often available through your hosting provider).
- Look at the browser console. Open Developer Tools (F12) and go to the Network tab. Reload the page and look at the redirect chain. It will show you the status codes and URLs. If you see a loop between http and https, the problem is a redirect rule. If you see a loop between your domain and www, you have a canonical redirect issue.
- Temporarily disable all plugins. Rename the
pluginsfolder in wp-content toplugins_oldvia FTP. If the site loads, a plugin is causing the issue. Rename it back and deactivate plugins one by one. - Check your Cloudflare Page Rules. If you have a page rule that forces HTTPS or redirects, it might be conflicting. Go to Rules → Page Rules and review any rules that involve your domain.
Frequently Asked Questions
Why does Cloudflare cause a redirect loop?
Cloudflare acts as a reverse proxy. If your SSL mode is set to Flexible, Cloudflare connects to your server over HTTP. If your WordPress or server then tries to force HTTPS, the request gets sent back to Cloudflare, which again connects over HTTP, and so on—creating an infinite loop.
Should I use Full or Full (strict) SSL?
Use Full (strict) if your server has a valid SSL certificate (not self-signed). It verifies the certificate and is more secure. If you get a certificate error, switch to Full. Avoid Flexible unless you have no SSL on your server at all.
Can I fix the loop without accessing WordPress admin?
Yes. You can edit wp-config.php via FTP or your hosting file manager to add the HTTPS trust code. You can also change the site URL directly in the database using phpMyAdmin, but editing wp-config.php is simpler and safer.
Will clearing Cloudflare cache fix the loop?
Clearing cache alone won’t fix the root cause, but it’s necessary after changing SSL settings. If you don’t clear it, Cloudflare might still serve the old cached redirects.
What if I’m using a CDN or caching plugin?
Clear those caches too. Some caching plugins have their own SSL settings that need to be configured to work with Cloudflare. Look for an option like “Support Cloudflare” or “HTTPS” in the plugin settings.
After fixing the loop, my site loads but images are broken or mixed content warnings appear.
This is usually because some URLs in your database are still using http. Use a plugin like “Better Search Replace” to update all http://yourdomain.com to https://yourdomain.com in the database. Always backup your database before doing this.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Blockchain vs Database: When Does Distributed Trust Win?
- GTA 6 and Call of Duty on Same Console?
- MCP in Production: Security Failures Behind the Backdoor Label
- Nothing Phone 2 Waterproof? IP54 Rating Explained
- Satellite Internet Equipment & Installation Guide
- India 24 7 Kids Story Stream English Hindi Playlists3.75 count