Skip to main content
Zass Tech
Free audit
Web Development6 min read

Cloudflare Setup for WooCommerce: DNS, SSL Mode and the Settings That Matter

By Shakh Farid·November 18, 2026·0 views
#Cloudflare#WooCommerce#DNS#SSL#Website Security#cPanel

Short answer: On Cloudflare's free plan, proxy (orange cloud) only the records that serve the website, usually the root domain and www. Keep mail, FTP and cPanel records as DNS only (grey cloud). Use SSL mode Full (strict) once your server has a valid certificate, turn on Always Use HTTPS, set the minimum TLS version to 1.2, and tell your security plugin to read the visitor's IP from the CF-Connecting-IP header.

What Cloudflare does for a WooCommerce shop

When the proxy is on, visitors connect to Cloudflare, and Cloudflare connects to your server. On the free plan that gives you:

  • static files from the edge: images, CSS and JavaScript are cached in Cloudflare's data centres;
  • bot filtering: Bot Fight Mode challenges known automated traffic;
  • DDoS protection in front of your hosting;
  • free SSL between visitors and Cloudflare.

It doesn't cache your HTML pages by default, so it doesn't replace a page cache plugin. It works alongside one.

Step 1: Move the nameservers

Add the domain in Cloudflare. It scans and imports your existing DNS records. Check the import against your current DNS zone before you switch. Missing records are the most common cause of "email stopped working after Cloudflare."

Then change the nameservers at your domain registrar to the two Cloudflare gives you. Propagation usually takes from a few minutes to a few hours.

Step 2: Decide which records to proxy

This is where most problems come from. Cloudflare's free proxy handles web traffic (HTTP and HTTPS) only. Anything else must be DNS only.

On a typical cPanel account, this is the split I used:

RecordProxy?Why
example.com (A)ProxiedThe website
www (CNAME)ProxiedThe website
mailDNS onlyEmail apps connect with IMAP/SMTP, not HTTP
ftpDNS onlyFTP isn't web traffic
cpanel, whm, webmail, webdiskDNS onlyThey use non-standard ports
autoconfig, autodiscoverDNS onlyEmail client setup
cpcalendars, cpcontactsDNS onlyCalendar and contacts sync
MX, TXT (SPF, DKIM)n/aCan't be proxied

If you proxy mail or ftp, email apps and FTP uploads stop working. Cloudflare will show a warning that your origin IP is exposed by DNS-only records. On shared hosting that's unavoidable if mail runs on the same server; the website traffic is still protected.

Step 3: Pick the right SSL mode

Cloudflare's SSL mode controls the connection between Cloudflare and your server:

ModeCloudflare to serverUse it?
OffNo HTTPS at allNever
FlexiblePlain HTTPAvoid. Your server sees HTTP, WordPress redirects to HTTPS, and you get redirect loops. Traffic to the server isn't encrypted.
FullHTTPS, any certificateOnly as a temporary step
Full (strict)HTTPS, valid certificate requiredUse this

Most cPanel and hPanel hosts issue a free Let's Encrypt or AutoSSL certificate. Once it's active, choose Full (strict). Newer Cloudflare accounts may show "Automatic SSL/TLS," which picks a mode for you; on the store I set up, it had chosen plain "Full," so I set Full (strict) manually.

🎯
Zass Tech service
Google Ads Management

Full-funnel campaign management, from setup to scaling spend profitably.

→

The error codes you'll meet

  • 525 (SSL handshake failed): Cloudflare can't make an HTTPS connection to your server at all. Usually the server has no certificate yet.
  • 526 (invalid SSL certificate): you're on Full (strict) and the server's certificate is expired, self-signed or for a different domain.

I saw a 525 during a hosting migration. The domain pointed at the new server before the host had issued its certificate. The fix was to switch the records to DNS only for a few minutes so the host could issue the certificate, then turn the proxy back on. Details in the migration write-up.

Step 4: Settings worth turning on

Under SSL/TLS > Edge Certificates:

  • Always Use HTTPS: on.
  • Minimum TLS Version: 1.2. TLS 1.0 and 1.1 are outdated, and every current browser supports 1.2.
  • Automatic HTTPS Rewrites: on. It fixes leftover http:// links to images and scripts.

Under Security > Bots:

HSTS is worth enabling once you're sure every subdomain works over HTTPS. It's hard to undo, because browsers remember it, so don't rush it.

Step 5: Fix the visitor IP in WordPress

Behind Cloudflare, REMOTE_ADDR on your server is a Cloudflare IP. Anything that uses the visitor's IP sees the wrong address:

  • security plugins block or rate-limit Cloudflare instead of the attacker;
  • login lockouts can lock everyone out at once;
  • custom rate limits treat all visitors as one.

In Wordfence, go to All Options > General Wordfence Options > How does Wordfence get IPs and pick the CF-Connecting-IP option. In your own code, read $_SERVER['HTTP_CF_CONNECTING_IP'] when it's present (and only trust it when the site is really behind Cloudflare).

Watch out: Cloudflare caches some files you might not expect

Cloudflare caches a list of static file types by default, and that list includes archives like .zip, .gz, .tar and .rar, plus documents like .pdf. If a backup file ever ends up in your public folder, Cloudflare can keep serving a copy after you delete it from the server. Purge the URL under Caching > Configuration > Custom Purge as part of the cleanup. I ran into exactly that (the backup file story).

FAQ

Which Cloudflare SSL mode should I use for WordPress?

Full (strict), as long as your hosting has a valid SSL certificate. Avoid Flexible: it leaves the connection to your server unencrypted and often causes redirect loops in WordPress.

Should I proxy the mail record in Cloudflare?

No. Cloudflare's proxy only handles web traffic. Proxying mail, ftp or cPanel records breaks email apps, FTP and the control panel. Keep them DNS only.

Why do I get error 525 or 526 after enabling Cloudflare?

525 means Cloudflare couldn't make an HTTPS connection to your server, usually because there's no certificate. 526 means the certificate is invalid while you're on Full (strict). Install or renew the hosting SSL certificate.

Does Cloudflare cache WooCommerce pages?

Not HTML by default. It caches static files such as images, CSS and JavaScript. Use a page cache plugin on the server for HTML, with cart and checkout excluded.


This is the setup I run for a live Bangladeshi stationery e-commerce store. Want Cloudflare set up properly for your site? Get in touch through my web development service.

📊
Zass Tech service
GA4 & GTM Setup

Clean, accurate tracking infrastructure that reports numbers you can trust.

→

Found this useful?

Share it with someone who's fighting the same tracking headaches.

Shakh Farid

Written by

Shakh Farid

Founder, Zass Tech

More from Shakh →