Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
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
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting

Cloudflare WordPress WP Admin Not Working: Causes and How to Fix It

Cloudflare WordPress WP Admin Not Working: Causes and How to Fix It

Short answer

Cloudflare breaks wp-admin when it caches admin pages, uses Flexible SSL, runs Rocket Loader on admin scripts, or blocks admin requests with firewall rules. Pause Cloudflare to confirm, then bypass cache for admin paths, switch to Full strict SSL and exclude wp-admin from Rocket Loader and challenges.

Key takeaways

  • Pause Cloudflare first to confirm it is the cause.
  • Bypass cache for wp-admin, wp-login and logged-in cookies.
  • Flexible SSL causes redirect loops, so use Full strict.
  • Rocket Loader can break the editor and admin menus.
  • Check Security Events for blocked admin-ajax or REST requests.
  • Restore real visitor IPs so login limiters do not block Cloudflare.

Why does wp-admin stop working after adding Cloudflare?

Most wp-admin problems behind Cloudflare come from caching admin pages, Rocket Loader changing admin scripts, the wrong SSL mode causing redirect loops, or firewall rules blocking logged-in requests.

Cloudflare sits between visitors and your server. That is great for speed and security on public pages. But the WordPress dashboard is private, dynamic and full of JavaScript, so settings that help the front end can break the back end.

Typical symptoms include:

  • Too many redirects when you open wp-login.php.
  • The login form reloads without logging you in.
  • The dashboard loads but menus, the block editor or media library do not work.
  • Saving a post fails or spins forever.
  • A Cloudflare challenge or block page appears on admin URLs.
  • An error code such as 520, 521 or 522 on admin pages only.

The fastest way to confirm Cloudflare is involved is to pause it briefly. In the Cloudflare dashboard, open your domain's Overview page and use Pause Cloudflare on Site in the sidebar. If wp-admin works while paused, the cause is a Cloudflare setting.

If wp-admin also fails with Cloudflare paused, the problem is on your server. Start with our guide on wp-admin not loading instead.

Is Cloudflare caching your admin pages?

If you use a Cache Everything rule without excluding wp-admin and wp-login.php, Cloudflare may cache private pages, which breaks logins and shows stale dashboards.

By default Cloudflare does not cache HTML. Many site owners add a rule to cache everything for speed. That rule must skip WordPress's private paths.

Signs of an over-eager cache:

  • You log in, but the next page still shows the login form.
  • Another user's admin bar appears on a page.
  • Changes you saved do not show in the dashboard.

To fix it, create a cache rule that bypasses cache for:

  • URI path starts with /wp-admin
  • URI path equals /wp-login.php
  • Requests with a cookie containing wordpress_logged_in

In current Cloudflare dashboards this lives under Caching > Cache Rules. Cloudflare's Cache Rules documentation explains how to build expressions. Put the bypass rule above any Cache Everything rule so it wins.

Our guide on Cloudflare cache rules for WordPress has a full rule set you can copy.

After saving, purge the cache. See how to clear Cloudflare cache in WordPress for the options.

Could the SSL mode cause a redirect loop?

Yes, Cloudflare's Flexible SSL mode is a common cause of too-many-redirects errors on wp-login.php, and switching to Full or Full (strict) usually fixes it.

In Flexible mode, visitors connect to Cloudflare over HTTPS, but Cloudflare talks to your server over plain HTTP. WordPress sees an HTTP request, decides it should be HTTPS, and redirects. Cloudflare sends the redirect back to the browser, which tries again. The loop never ends.

Fix it like this:

  1. Make sure your server has a valid SSL certificate. Most hosts offer a free one.
  2. In Cloudflare, go to SSL/TLS > Overview and choose Full (strict).
  3. Clear your browser cookies for the site and try again.

The Cloudflare encryption modes documentation explains each mode.

Our guide on Cloudflare SSL settings for WordPress covers the full SSL setup.

If the loop continues, the Cloudflare redirect loop fix goes deeper.

If you cannot install a certificate on the server yet, a temporary workaround is to tell WordPress the request is HTTPS when Cloudflare says so. That involves a few lines in wp-config.php, as described in the WordPress HTTPS documentation. Treat it as a stopgap, not a long-term fix.

Is Rocket Loader breaking the dashboard?

Rocket Loader changes how JavaScript loads, and it can break the block editor, page builders and admin menus, so turn it off for wp-admin or for the whole site.

Rocket Loader delays scripts to speed up first paint. WordPress admin screens rely on scripts loading in a set order. When that order changes, buttons stop responding and editors fail to load.

You can disable it in two ways:

  • Site-wide: go to Speed > Optimization > Content Optimization and switch Rocket Loader off.
  • For admin only: create a Configuration Rule that matches URI path starts with /wp-admin and sets Rocket Loader to off.

Cloudflare's Rocket Loader documentation lists known compatibility limits. If your theme or page builder recommends turning it off, follow that advice.

Older guides also mention Auto Minify. Cloudflare has retired that feature, so if you read about it in an old tutorial, skip that step.

Is the Cloudflare firewall blocking admin requests?

WAF rules, Bot Fight Mode, rate limiting or Under Attack Mode can block or challenge admin-ajax and REST API calls, which makes the dashboard fail without a clear error.

The WordPress dashboard makes many background requests. The two that matter most are /wp-admin/admin-ajax.php and /wp-json/. If Cloudflare challenges these, the browser cannot answer the challenge, and the request fails.

Check Security > Events in Cloudflare. Filter by your own IP address. If you see blocks or challenges on admin paths, you have found the cause.

Fixes include:

  • Add a custom rule that skips managed rules or challenges for your IP on admin paths.
  • Make sure no rate limiting rule matches admin-ajax.php at a low threshold.
  • Turn off Under Attack Mode once an attack has passed.
  • If Bot Fight Mode is blocking tools you rely on, consider whether you need it on.

Cloudflare's WAF custom rules documentation shows how to write skip and allow rules. Our guide to Cloudflare WAF rules for WordPress has examples that protect login pages without locking you out.

Are security plugins locking you out because of Cloudflare IPs?

If your server does not restore visitor IPs, every request looks like it comes from Cloudflare, so login limiters may block Cloudflare itself and lock out every admin.

Plugins that limit login attempts track IP addresses. Behind Cloudflare, the raw connection comes from a Cloudflare server. Cloudflare passes the real visitor IP in the CF-Connecting-IP header.

If the plugin reads the wrong IP, a handful of failed logins from anyone can block a Cloudflare IP. Then everyone routed through that server is locked out, including you.

To fix this:

  • Set your security plugin to read the real IP from the Cloudflare header. Most have this option in their settings.
  • Ask your host to enable IP restoration for Cloudflare at the server level.
  • Clear the lockout list in the plugin, or rename the plugin folder over FTP if you cannot log in.

The Cloudflare guide to restoring original visitor IPs covers server options. If a firewall plugin is the problem, our guide on Wordfence blocking admin shows how to undo a lockout.

What if you see a 520, 521 or 522 error on wp-admin?

These errors mean Cloudflare could not get a good response from your server, which points to a server problem, a firewall blocking Cloudflare, or a timeout on heavy admin pages.

Cloudflare shows its own error page when your origin misbehaves. Admin pages are heavier than public ones, so they hit limits first.

ErrorCommon cause on admin pagesWhere to start
520Server returned an empty or odd response, often from a PHP crashFix Cloudflare error 520
521Server refused Cloudflare's connectionFix Cloudflare error 521
522Server took too long to respondFix Cloudflare error 522
525SSL handshake failed between Cloudflare and serverFix Cloudflare error 525

Long imports, big updates and plugin scans can exceed Cloudflare's response time limit. Run heavy jobs with WP-CLI or a background task instead of through the browser.

Is the Cloudflare plugin or APO causing the problem?

Cloudflare's WordPress plugin and Automatic Platform Optimization are built to skip admin pages, but bad settings, outdated versions or conflicts with cache plugins can still break the dashboard.

APO caches full HTML at the edge. It uses WordPress cookies to bypass cache for logged-in users. If a cache plugin strips those cookies or a custom rule overrides APO, admins may get cached pages.

Steps to check:

  1. Update the Cloudflare plugin to the latest version.
  2. Turn APO off briefly and test wp-admin.
  3. Make sure you are not running two systems that both purge and cache HTML.

Our guide on the Cloudflare WordPress plugin not working covers connection and API token problems.

How do you test changes safely?

Use Development Mode or pause Cloudflare while testing, change one setting at a time, and check in a private browser window so old cookies and cache do not mislead you.

A clean testing routine saves hours:

  1. Turn on Development Mode under Caching > Configuration. It bypasses the cache for a few hours.
  2. Change one setting.
  3. Open a private browser window and log in.
  4. If it works, turn Development Mode off and test again.

Keep a note of what you changed. If you need to contact your host or Cloudflare support, that list helps them find the cause faster.

How do you get back in if you are fully locked out?

Pause Cloudflare or switch DNS records to DNS only, then log in directly to your server and undo the setting or plugin that caused the lockout.

When the dashboard is unreachable:

  • In Cloudflare DNS, click the orange cloud on your main record to make it grey. Traffic then goes straight to your server. DNS changes can take a few minutes.
  • Use your host's file manager or FTP to rename a plugin folder that is blocking you.
  • Check that the site and home URLs in the database use https if you changed SSL modes.

Our guide on being locked out of wp-admin covers database and file fixes. Once you are in, turn Cloudflare back on with the corrected settings.

Frequently asked questions

Should Cloudflare cache the WordPress admin area?

No. The admin area is private and changes with every action, so caching it causes stale pages and login failures. Create a rule that bypasses cache for admin paths, the login page and requests carrying the WordPress logged-in cookie.

Why do I get too many redirects on wp-login?

This usually happens when Cloudflare uses Flexible SSL while WordPress expects HTTPS. Each side keeps redirecting the other. Install a certificate on your server, switch Cloudflare to Full strict mode, and clear your browser cookies before trying again.

Is it safe to pause Cloudflare to test?

Yes, for short tests. Pausing sends traffic straight to your server, so you lose Cloudflare's protection and caching while it is paused. Make sure your server has its own SSL certificate first, and turn Cloudflare back on when testing is done.

Can Rocket Loader break the block editor?

It can. Rocket Loader changes when scripts load, and the block editor and many page builders expect scripts in a specific order. Turn it off site-wide or create a rule that disables it for admin paths, then reload the editor.

How do I see what Cloudflare blocked?

Open the Security Events log in your Cloudflare dashboard and filter by your IP address or by admin paths. Each event shows which rule or feature acted on the request, so you know which setting to adjust or skip.

Sources

  1. Cache Rules Cloudflare Docs
  2. Encryption modes Cloudflare Docs
  3. Rocket Loader Cloudflare Docs
  4. WAF custom rules Cloudflare Docs
  5. Cloudflare plugin WordPress.org

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

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.