Cloudflare Page Rules for WordPress

Learn to setup Cloudflare Page Rules

Cloudflare Page Rules

Page Rule 1

Use this rule to redirect www to naked domain.

  • *www.your-site.com/
  • Forwarding URL
  • 301 – Permanent Redirect
  • https://your-site.com /$2

Similar rule can be created to redirect naked domain to www.

Page Rule 2

Use this rule to protect XML-RPC file.

  • https://your-site.com/xmlrpc.php
  • Forwarding URL
  • 301 – Permanent Redirect
  • https://your-site.com/

Page Rule 3

This rule is for Preview pages.

  • https://your-site.com/*preview=true*
  • Cache Level – Standard
  • Origin Cache Control On

Page Rule 4

Use this page rule for Search pages.

  • https://your-site.com/?s=*
  • Browser Integrity Check On
  • Cache Level – Cache Everything
  • Origin Cache Control On
Pay Yearly, Get 2 Months FREE

Page Rule 5

Use this page rule for Feed pages.

  • https://your-site.com/feed*
  • Cache Level – Cache Everything
  • Edge Cache TTL – a day
  • Origin Cache Control On

Page Rule 6

Use this page rule for Sitemap pages.

  • https://your-site.com/sitemap*
  • Cache Level – Cache Everything
  • Edge Cache TTL – a day
  • Origin Cache Control On

Page Rule 7

Use this page rule for wp-admin.

  • https://your-site.com/wp-admin*
  • Browser Integrity Check On
  • Cache Level – Standard
  • Edge Cache TTL – a day
  • Origin Cache Control On
14 Days Free Trial

Page Rule 8

Use this page rule for wp-includes.

  • https://your-site.com/wp-includes*
  • Browser Integrity Check On
  • Cache Level – Standard
  • Edge Cache TTL – a day
  • Origin Cache Control On

Page Rules 9

Use this page rule for wp-content.

  • https://your-site.com/wp-content*
  • Browser Integrity Check On
  • Cache Level – Standard
  • Edge Cache TTL – a day
  • Origin Cache Control On

Page Rule 10

Use this page rule for wp-json.

  • https://your-site.com/wp-json*
  • Browser Integrity Check On
  • Origin Cache Control On
  • Cache Level – Standard

Page Rule 11

Use this page rule for rest_route.

  • https://your-site.com/rest_route*
  • Browser Integrity Check On
  • Origin Cache Control On
  • Cache Level – Standard

Page Rule 12

Use this page rule for important pages like about, contact, terms, etc…

  • https://your-site.com/about/
  • Cache Level – Cache Everything
  • Edge Cache TTL – a month
  • Origin Cache Control On
  • Always Online On
Improve Sales & Service with Chat & Ticketing System

Page Rule 13

Use this rule for rest of the pages.

  • https://your-site.com/*
  • Cache Level – Cache Everything
  • Edge Cache TTL – a day
  • Origin Cache Control On

Above page rules are just an example. Customize according to your requirement.

If you like to setup page rules for your site, contact me.