A correct Cloudflare setup comes down to five decisions: proxy only the web records (A, AAAA, CNAME), use SSL mode Full (strict) with a valid certificate on the origin, restore real visitor IPs in nginx, add a cache rule for HTML, and turn on Bot Fight Mode only after checking your APIs. Flexible mode does not suit WordPress: on our test bench the home page loaded fine while the admin login went into an endless redirect loop.
How we tested
RichHost test bench: isolated container, 2 vCPU / 8 GB, Ubuntu 24.04, nginx 1.24, PHP 8.3-FPM, MariaDB 10.11, WordPress 6.7.2, 25 October 2026. There is no real Cloudflare on the bench, so a separate nginx instance played its role: it accepted HTTPS from a “visitor” at 127.0.0.55, forwarded the request to a separate WordPress copy with the site URL https://r14.test from a “proxy” address 127.0.0.10, and added the same headers Cloudflare sends (CF-Connecting-IP, X-Forwarded-For, X-Forwarded-Proto, CF-Visitor). The Off, Flexible, Full and Full (strict) modes were reproduced with proxy_pass and proxy_ssl_verify. Helper curl options (our own root certificate, address override, source IP) are removed from the commands below and log lines are shortened. Headers of real Cloudflare sites were read from a browser with fetch(), because the bench proxy blocks outbound curl. Free plan facts were checked on developers.cloudflare.com on 25.10.2026. The site copy, database and configs were deleted after the tests.
What the Free plan gives you: facts from the docs
We checked the Free plan limits against the Cloudflare documentation on 25 October 2026. Each link points to the page the number comes from.
| Feature | Free plan | Source |
|---|---|---|
| Universal SSL | Free certificate for the apex and first-level subdomains (www.example.com). Deeper names like a.b.example.com are not covered | Universal SSL |
| Default SSL mode | Automatic SSL/TLS: Cloudflare moves to the most secure mode your origin supports and never downgrades | Encryption modes |
| Cache without rules | Static files by extension. HTML and JSON are not cached, nor are responses with Set-Cookie or Cache-Control: private, no-store, no-cache, max-age=0 | Default cache behavior |
| Cache Rules | 10 rules (Pro 25, Business 50) | Cache Rules |
| Page Rules | Marked as deprecated, 3 rules on Free. Modern rules take precedence over Page Rules | Page Rules, migration |
| Redirect Rules | 10 Single Redirects per zone | Redirects |
| WAF custom rules | 5 rules, no regex | Custom rules |
| Rate limiting | 1 rule, 10-second counting period and timeout, fields limited to path and Verified Bot | Rate limiting rules |
| Bot Fight Mode | Free. It cannot be skipped with WAF custom rules or Page Rules and may challenge API and mobile app traffic | Bot Fight Mode |
| DNS proxying | Only A, AAAA and CNAME records. MX and TXT are always DNS only | Proxy status |
DNS: what to proxy
Put only the records that serve your website behind the orange cloud (Proxied): A and AAAA for the domain, CNAME for www. Keep mail DNS only: MX cannot be proxied, and if you proxy the mail A record that the MX points to, mail servers will look for your server on Cloudflare addresses. DKIM and other service records, as well as hostnames for SSH or FTP, must stay DNS only too, because Cloudflare proxies HTTP and HTTPS, not arbitrary protocols. Our guide to DNS records and domain management explains the record types, and the steps at the registrar are in how to change domain nameservers.
To confirm a domain already goes through Cloudflare, open /cdn-cgi/trace on it. On www.cloudflare.com and cdnjs.cloudflare.com it returned plain text with colo=WAW (the Warsaw data center), http=http/3, tls=TLSv1.3 and visit_scheme=https. The same data center code appears at the end of the cf-ray header.
SSL modes: what actually happens
The mode defines how Cloudflare connects to your origin. We ran all four modes against the same WordPress copy, changing only the “proxy” settings.

| Mode | Cloudflare to origin | What we saw on the bench | When to use |
|---|---|---|---|
| Off | HTTP, visitor on HTTP too | In our imitation the “proxy” had no HTTPS: https:// did not open. http:// worked, but wp-login.php redirected to https:// and the connection failed | Never for a site with forms |
| Flexible | HTTP | Home page: 200. /wp-login.php and /wp-admin/: loop, 20 redirects (302). With an HTTPS redirect in nginx the whole site looped (301) | Only temporarily, when the origin has no certificate and no HTTPS redirects |
| Full | HTTPS, certificate not validated | Self-signed certificate: 200, login works, http:// reaches https:// in one redirect | A transition step while you issue a valid certificate |
| Full (strict) | HTTPS, certificate validated | Valid certificate: 200. Self-signed or wrong hostname: 502 (error 526 on Cloudflare) | The default choice for any site |
Reproducing the Flexible loop
A WordPress copy with the site URL https://r14.test, “Cloudflare” in Flexible mode, no redirects on the origin:
$ curl -so /dev/null -L --max-redirs 20 -w 'code=%{http_code} redirects=%{num_redirects}\n' https://r14.test/
code=200 redirects=0
$ curl -so /dev/null -L --max-redirs 20 -w 'code=%{http_code} redirects=%{num_redirects}\n' https://r14.test/wp-login.php
curl: (47) Maximum (20) redirects followed
code=302 redirects=20
$ curl -sI https://r14.test/wp-login.php
HTTP/1.1 302 Found
Location: https://r14.test/wp-login.php
# origin log: the proxy connects over HTTP, WordPress redirects to the same URL
127.0.0.10 xfp=https "GET /wp-login.php HTTP/1.0" 302 loc="https://r14.test/wp-login.php"
127.0.0.10 xfp=https "GET /wp-login.php HTTP/1.0" 302 loc="https://r14.test/wp-login.php"
The cause is WordPress itself: when the site URL starts with https://, it turns on FORCE_SSL_ADMIN automatically (wp-includes/default-constants.php). The request from Cloudflare arrives over HTTP, so the login page redirects to HTTPS, Cloudflare connects over HTTP again, and so on forever. Visitors do not notice because the home page is served without a redirect, but the owner cannot log in. When we added a standard nginx redirect if ($scheme = http) { return 301 https://$host$request_uri; } on the origin, the loop covered the whole site: 20 responses 301 on the home page. In a browser this is ERR_TOO_MANY_REDIRECTS; causes unrelated to Cloudflare are covered in ERR_TOO_MANY_REDIRECTS fix.
How to remove the loop
The right fix is a certificate on the origin plus Full (strict). On the same copy, with the nginx redirect still in place, the home page and login page returned 200 with no extra redirects. Issue the certificate before switching the mode; our article on the SSL certificate on shared hosting covers the details.
A common alternative is to keep Flexible and add a line to wp-config.php that trusts the X-Forwarded-Proto header:
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) { $_SERVER['HTTPS'] = 'on'; }
The loop did disappear (home and login: 200). But traffic between Cloudflare and the origin is still unencrypted, admin password included, and the origin trusts the header from anyone. A direct HTTP request to the origin with a forged X-Forwarded-Proto: https got the login page with 200, while the same request without the header was redirected to HTTPS. It is a patch, not a configuration.
Full (strict) and error 526
In strict mode Cloudflare validates the origin certificate: it must come from a trusted CA, must not be expired and must contain your hostname. Our “proxy” with the same validation responded like this:
# self-signed certificate on the origin upstream SSL certificate verify error: (18:self-signed certificate) while SSL handshaking to upstream # certificate from a trusted CA, but for another name (other.test) upstream SSL certificate does not match "r14.test" while SSL handshaking to upstream # valid certificate for r14.test https / -> code=200
A Cloudflare visitor would see error 526 in both of the first cases. To check the origin certificate directly, bypassing Cloudflare, run this (replace 203.0.113.10 with your server IP):
curl -svo /dev/null --resolve example.com:443:203.0.113.10 https://example.com/ 2>&1 | grep -iE 'subject:|issuer:|expire date|SSL certificate problem'
On the bench, for a certificate trusted only by the “proxy” (which is how a Cloudflare Origin CA certificate behaves), it printed SSL certificate problem: unable to get local issuer certificate, and with -k it showed the subject, issuer and expiry date. So with Origin CA the site works only through the proxy: switch the record to DNS only and browsers will show an error. A Let’s Encrypt certificate has no such dependency.
Real visitor IPs
Once Cloudflare is in front, the origin sees Cloudflare addresses instead of visitors. Logs, login limiters and Fail2Ban then block the wrong addresses. Before the fix, both the nginx log and PHP on the bench showed the “proxy” address:
# without real_ip: proxy address in the log and in PHP 127.0.0.10 cf-connecting-ip=127.0.0.55 "GET /r14-ip.php HTTP/1.0" 200 REMOTE_ADDR=127.0.0.10 # after set_real_ip_from 127.0.0.10; real_ip_header CF-Connecting-IP; 127.0.0.55 cf-connecting-ip=127.0.0.55 "GET /r14-ip.php HTTP/1.0" 200 REMOTE_ADDR=127.0.0.55
Trust the header only from Cloudflare networks. We sent a request straight to the origin from 127.0.0.77 with a forged CF-Connecting-IP: 203.0.113.66:
# set_real_ip_from limited to the proxy: forgery ignored REMOTE_ADDR=127.0.0.77 # set_real_ip_from 0.0.0.0/0: the origin believed the forgery 203.0.113.66 cf-connecting-ip=203.0.113.66 "GET /r14-ip.php HTTP/1.1" 200 REMOTE_ADDR=203.0.113.66
A ready nginx file with all ranges from cloudflare.com/ips (checked 25.10.2026, passes nginx -t). Include it in the http or server block and re-check the list from time to time, as Cloudflare recommends updating it regularly:
# /etc/nginx/conf.d/cloudflare-realip.conf set_real_ip_from 173.245.48.0/20; set_real_ip_from 103.21.244.0/22; set_real_ip_from 103.22.200.0/22; set_real_ip_from 103.31.4.0/22; set_real_ip_from 141.101.64.0/18; set_real_ip_from 108.162.192.0/18; set_real_ip_from 190.93.240.0/20; set_real_ip_from 188.114.96.0/20; set_real_ip_from 197.234.240.0/22; set_real_ip_from 198.41.128.0/17; set_real_ip_from 162.158.0.0/15; set_real_ip_from 104.16.0.0/13; set_real_ip_from 104.24.0.0/14; set_real_ip_from 172.64.0.0/13; set_real_ip_from 131.0.72.0/22; set_real_ip_from 2400:cb00::/32; set_real_ip_from 2606:4700::/32; set_real_ip_from 2803:f800::/32; set_real_ip_from 2405:b500::/32; set_real_ip_from 2405:8100::/32; set_real_ip_from 2a06:98c0::/29; set_real_ip_from 2c0f:f248::/32; real_ip_header CF-Connecting-IP;
On shared hosting the provider usually manages the nginx configuration, so ask support whether the real IP is restored from CF-Connecting-IP. Checking is easy: leave a comment or try a wrong password and see which IP the site recorded.
Caching: what the headers show
The cf-cache-status header shows the Cloudflare cache state. From a browser we requested URLs on five public sites served through Cloudflare with fetch(): unpkg.com, cdnjs.cloudflare.com, developers.cloudflare.com, www.cloudflare.com and cloudflare-dns.com. Only unpkg.com sends Access-Control-Expose-Headers: *, so only there could the script see everything: server: cloudflare, cf-cache-status: HIT, cf-ray: ...-WAW, age: 258460. The other sites exposed only basic headers such as content-type and cache-control, and cf-cache-status stayed hidden. For your own site, look at the Network tab in developer tools or run curl -sI: CORS does not apply there.
One more observation: three requests to a file on unpkg.com with a fresh, never used ?r14=... parameter all got HIT with the same age as without it. So on that site the query string is not part of the cache key. This is a per-site setting, so test your own the same way: a new parameter should give MISS if query strings are in the key.
| cf-cache-status | Meaning |
|---|---|
| HIT | Served from the Cloudflare cache, the origin did no work |
| MISS | Cacheable, but not in cache yet, so it came from the origin |
| EXPIRED | The cached copy was stale, Cloudflare fetched a new one |
| BYPASS | The request was cache-eligible, but the origin response was not cacheable (for example, Set-Cookie) |
| DYNAMIC | Not eligible for cache, Cloudflare did not even look it up. Typical for HTML without rules |
To cache WordPress pages you need a rule in Caching → Cache Rules, with the admin area and logged-in users bypassing the cache. According to the docs, when several rules match, the last matching rule wins for the same setting, so put the bypass rule below. These are example Cloudflare expressions, not bench results:
# Rule 1 "Cache pages" (http.host eq "example.com") Cache eligibility: Eligible for cache Edge TTL: Ignore cache-control header and use this TTL - 4 hours # Rule 2 "Bypass admin and logged-in users" (below rule 1) (starts_with(http.request.uri.path, "/wp-admin") or http.request.uri.path eq "/wp-login.php" or starts_with(http.request.uri.path, "/wp-json") or http.cookie contains "wordpress_logged_in" or http.cookie contains "wp-postpass" or http.cookie contains "comment_author" or http.cookie contains "woocommerce_items_in_cart") Cache eligibility: Bypass cache
The Cloudflare cache does not replace caching on the server: a page that misses the cache is still built by PHP and the database. Server-side options are covered in our article on cache and RAM on hosting. While working on the design, turn on Development Mode: it bypasses the cache for three hours without purging it.
Bot protection on the Free plan
Bot Fight Mode (Security → Settings, filter Bot traffic) is a single toggle, but it has two consequences worth knowing in advance. First, it has no exceptions: Skip, Bypass and Allow actions in WAF rules do not affect it, only an IP Access rule does. Second, it may challenge API and mobile app traffic. If your site receives payment webhooks or serves an app, test those integrations after turning it on.
Five WAF custom rules on Free cover the most common cases. Example expressions:
# Block xmlrpc.php (breaks Jetpack and the WordPress mobile app) (http.request.uri.path eq "/xmlrpc.php") Action: Block # Scans for service files (http.request.uri.path contains "/.env" or http.request.uri.path contains "/.git/") Action: Block # The single rate limiting rule on Free: login page, 10-second period (http.request.uri.path eq "/wp-login.php") Action: Block for 10 seconds
FAQ
Can I keep Flexible if the site opens?
No. On the bench the home page worked in Flexible, but the admin login was unreachable because of the loop, and the link between Cloudflare and the origin stays unencrypted. Issue a certificate on the origin and switch to Full (strict).
Why does my security plugin block everyone at once?
Most often it sees the same Cloudflare IP for many people. Restore the real IP from CF-Connecting-IP and trust the header only from Cloudflare ranges.
Does Cloudflare cache WordPress pages out of the box?
No. HTML and JSON are not cached by default and the header shows DYNAMIC. You need a Cache Rule with a bypass for the admin area and logged-in users.
Do Page Rules still work?
Yes, Free includes 3, but the docs mark them as deprecated. Make new settings with Cache Rules, Redirect Rules and Configuration Rules, which take precedence over Page Rules.
Full (strict) needs a valid certificate on the origin. On RichHost hosting plans Let’s Encrypt certificates are free, so you can enable strict mode as soon as the domain is active on Cloudflare.


