Home/Blog/Cloudflare Cache Rules for WordPress (2026 Guide)

Cloudflare Cache Rules for WordPress (2026 Guide)

Cloudflare cache rules for WordPress — global edge network speeding up a website

By default, Cloudflare caches only static files like images, CSS, and JavaScript — your WordPress pages are built fresh by your server on every visit. Cloudflare Cache Rules for WordPress change that — they cache full HTML pages at Cloudflare’s edge, so visitors get your content in milliseconds. This 2026 guide shows you how to set them up on the free plan.

What Are Cloudflare Cache Rules?

Cache Rules are Cloudflare’s modern replacement for the old Page Rules. They tell Cloudflare’s edge servers what to cache, for how long, and what to skip, using simple conditions such as the URL path or cookies. When a visitor requests a matching page, Cloudflare serves the stored copy from the nearest data centre instead of your origin server generating it again.

WordPress is dynamic: every page load runs PHP and database queries. Caching the finished HTML at the edge removes that work — Cloudflare reports TTFB reductions of up to 72% when HTML caching is set up correctly.

Why Cache Rules Beat the Old Page Rules

Cloudflare deprecated Page Rules in July 2024, and since January 2025 no account can create new ones. Cache Rules offer more conditions and 10 rules on the free plan, versus 3. If an older tutorial gave you a “Cache Everything” Page Rule, rebuild it as a Cache Rule now.

Before You Start: What Cloudflare Caches by Default

Out of the box, Cloudflare caches static files only. HTML pages are treated as dynamic, so the response header shows CF-Cache-Status: DYNAMIC. That is normal — your goal is to turn it into CF-Cache-Status: HIT for public pages, while keeping admin, login, and logged-in sessions uncached.

How to Set Up Cloudflare Cache Rules for WordPress

In your Cloudflare dashboard, pick your domain and go to Rules > Cache Rules. You need three rules: one to cache public pages, one to bypass the admin area, and one to protect logged-in users — the first matching rule wins, so create them in this order.

Step 1: Create the Cache Everything Rule

Click Create rule and name it “Cache Everything”. Match all requests — the bypass rules below carve out the exceptions. Under Cache eligibility choose Eligible for cache, then set Edge TTL to 1 day and Browser TTL to 4 hours. A one-day edge TTL is a safe start: updates appear within a day, or instantly when you purge the cache.

Step 2: Bypass wp-admin and the Login Page

Create a second rule named “Bypass Admin”: URI Path contains /wp-admin/ OR URI Path contains /wp-login.php, with Cache eligibility set to Bypass cache. This is non-negotiable — a cached dashboard shows stale screens and failed logins.

Laptop showing a fast-loading WordPress website with a speed gauge on screen

Step 3: Bypass Logged-In Users and WooCommerce

Create a third rule, “Bypass Logged-In Users”: Cookie contains wordpress_logged_in, with the cache bypassed. Logged-in visitors must always see live, personal content. On WooCommerce, also bypass /cart/, /checkout/, and /my-account/ — a cached cart can show one shopper another shopper’s basket.

Step 4: Purge and Test

Save your rules, then go to Caching > Configuration and click Purge Everything once. Open your homepage in a private window and check the response headers. The first visit may show MISS; reload once and you should see CF-Cache-Status: HIT — proof your pages are now served from the edge.

Common Mistakes to Avoid

The most common error is caching everything with no bypass rules, so admin, cart, and login pages are served as static copies. The second is stacking a Cache Everything rule on top of Cloudflare APO, which already caches HTML — the two conflict and cause stale pages, so pick one method. The third is forgetting to purge the cache after updating a post; purge the single URL from Caching > Configuration whenever you edit important content. For more speed wins, read our guide on why your website is loading slow.

Cache Rules vs APO: Which Should You Use?

Cloudflare’s Automatic Platform Optimization (APO) costs $5 per month on the free plan and handles HTML caching automatically, with smart purging when you update a post. Cache Rules are free but need manual setup and purging. For most small blogs, Cache Rules are enough. If you publish constantly and want zero maintenance, APO is the easier path — see our comparison in is Cloudflare APO worth it. Either way, pair your choice with the best Cloudflare settings for WordPress.

Conclusion

Cloudflare Cache Rules are the free, future-proof way to make WordPress fast in 2026. Create a Cache Everything rule, bypass wp-admin, logins, and carts, and verify the HIT header. Ten minutes of setup buys faster load times and lower server load — and faster sites rank better too. Find more free tools and guides on the KamiWeb homepage.

Frequently Asked Questions

Are Cloudflare Cache Rules free?

Yes — Cache Rules are available on every plan, including free, which allows up to 10 rules.

What is the difference between Cache Rules and Page Rules?

Page Rules are the older, deprecated feature; Cache Rules replace them with more conditions and higher limits.

Will caching break my WordPress admin area?

Only if you skip the bypass rules. Always bypass /wp-admin/, /wp-login.php, and logged-in cookies so your dashboard stays live.

How do I know if Cloudflare caching is working?

Open your site in a private window and check the response headers for CF-Cache-Status: HIT. DYNAMIC means the page was not cached.