
Cloudflare for WordPress puts Cloudflare’s network between your visitors and your hosting server, so it can cache images, stylesheets and scripts closer to visitors, filter malicious requests with a web application firewall (WAF) and absorb DDoS traffic before it reaches WordPress. It does not replace hosting, plugin updates or backups. Set it up with SSL in Full (strict) mode, keep admin, login and checkout pages out of the cache, and leave your email records unproxied, and most sites get faster and safer without breaking anything.
What does Cloudflare do for a WordPress site?
When your domain’s nameservers point to Cloudflare and a DNS record is “proxied”, visitors connect to Cloudflare first. Cloudflare then decides whether to serve a cached copy, block the request, challenge it, or pass it to your hosting server (the origin). That gives you several layers:
- Content delivery (CDN). Static files are served from Cloudflare data centres near the visitor. Cloudflare has a data centre in Harare, which shortens the trip for visitors in Zimbabwe.
- DDoS mitigation. Floods of junk traffic are absorbed across Cloudflare’s network instead of overwhelming a small server.
- Web application firewall. Requests are checked against rules that match common attacks, such as SQL injection or attempts to exploit vulnerable plugins. Managed rulesets are available on paid plans.
- Bot management. Password-guessing and scraping bots can be challenged before they use up server resources.
- SSL and DNS. HTTPS between visitors and Cloudflare, encryption to your server when configured correctly, and fast DNS hosting.
What Cloudflare does not fix
Cloudflare is one layer, not a complete security plan. A vulnerable plugin is still vulnerable, a weak administrator password is still weak, and malware already on the site stays there until it is cleaned. Slow database queries, heavy page builders and uncached dynamic pages still depend on your hosting. Keep WordPress core, plugins and themes updated, use two-factor authentication for administrators, take daily backups and choose hosting with enough resources. If your site is already hacked, clean it first, then put Cloudflare in front of it.
How to set up Cloudflare on WordPress
- Prepare. Check the site works, take a full backup, and make sure you can log in to your registrar, hosting control panel and WordPress.
- Record your DNS. Note every existing record, especially A, CNAME, MX and TXT (SPF, DKIM, DMARC) records. Missing records are the most common cause of broken email after a switch.
- Add the domain to Cloudflare. Cloudflare scans your existing records. Compare its list with yours and add anything it missed.
- Choose what to proxy. Proxy (orange cloud) the root domain and www. Set mail-related records, such as mail.yourdomain and anything used by MX, to DNS only (grey cloud).
- Change nameservers at your registrar to the two Cloudflare gives you. Propagation can take a few hours.
- Set SSL to Full (strict). Your hosting must have a valid certificate first. Flexible mode leaves the server leg unencrypted and often causes redirect loops on WordPress.
- Install a plugin that talks to Cloudflare, such as the official Cloudflare plugin or the Cloudflare settings in LiteSpeed Cache, so cache is purged when you publish.
- Test. Check the homepage, forms, login, search, cart and checkout, on desktop and phone, and send a test email.
Which Cloudflare settings matter for WordPress?
Caching rules
Cache static files aggressively, but bypass the cache for /wp-admin/, wp-login.php, previews and any request carrying a WordPress logged-in cookie. On WooCommerce, also bypass the cart, checkout and my-account pages, or customers may see someone else’s basket. If you cache full HTML pages, make sure your purge on publish works.
Firewall rules for WordPress
- Rate-limit or challenge requests to wp-login.php to slow password guessing.
- Block xmlrpc.php if you do not use the WordPress mobile app or Jetpack features that need it.
- Limit /wp-admin/ to known countries or staff IP addresses where practical.
- Turn on the managed WordPress and OWASP rulesets on a paid plan, then watch the firewall log for a week for false positives on forms and payment callbacks.
Real visitor IP addresses
Behind a proxy, your server sees Cloudflare’s IP addresses. Make sure the server or plugin restores the real visitor IP from Cloudflare’s headers, or security plugins may block Cloudflare itself and your logs will be useless.
Speed features
Turn on Brotli compression, HTTP/3 and image optimisation where your plan includes it. Test before and after with PageSpeed Insights rather than assuming each switch helps.
Free Cloudflare, Cloudflare Pro or a managed service?
The software is the same Cloudflare network; the difference is the plan level and who configures and watches it.
| Option | Cost | Who configures and monitors | Suits |
|---|---|---|---|
| Cloudflare Free, self-managed | $0 | You | Personal sites and owners comfortable with DNS and firewall rules |
| Cloudflare Pro, bought direct | $25 a month billed monthly | You | Technical teams that want managed rulesets and will tune them |
| Tremhost Armor Guard (Cloudflare Pro) | $9 a month or $90 a year, one site | Tremhost sets the rules, moves DNS and monitors daily | Business sites with nobody in-house to look after security |
| Tremhost managed WordPress | From $15 a month | Cloudflare Pro included on every site, plus WordPress updates and malware removal | Owners who want hosting and protection in one plan |
Armor Guard works on any hosting and is typically live in about an hour. It includes Cloudflare’s WAF with rules set by Tremhost, unmetered DDoS protection, SSL renewal, attack and uptime monitoring with alerts, and support from Tremhost engineers on WhatsApp during working hours. Sites that take payments or hold client data can step up to Armor Shield (Cloudflare Business, $200 a month), which carries Cloudflare Business’s 100% uptime SLA. You can try Cloudflare Pro or Business free for 15 days with no card through the Tremhost Cloudflare trial.
If you would rather have hosting, updates and Cloudflare handled together, Tremhost managed WordPress hosting starts at $15 a month for one site and includes Cloudflare Pro, updates tested on staging, daily backups and malware scanning and removal.
Common problems after switching to Cloudflare
- Too many redirects: usually SSL set to Flexible while WordPress forces HTTPS. Switch to Full (strict).
- Email stopped: an MX or mail record was missed or proxied. Re-add it as DNS only.
- Changes not showing: purge the Cloudflare cache, and check the plugin’s purge settings.
- Forms or payments blocked: check the firewall events log and add a skip rule for the affected path or payment provider callback.
- Admin bar visible to visitors or wrong basket: HTML caching is ignoring logged-in or WooCommerce cookies. Add bypass rules.
Frequently asked questions
Is Cloudflare free for WordPress?
Yes, Cloudflare has a free plan with CDN, DNS, universal SSL and DDoS mitigation. Managed WAF rulesets and some optimisation features need a paid plan.
Will Cloudflare make my WordPress site faster?
Usually for static files and visitors far from your server. It will not fix slow plugins, heavy themes or an overloaded host, so measure before and after.
Does Cloudflare remove malware from WordPress?
No. It filters traffic before it reaches the site. An infected site needs cleaning; Tremhost’s Armor SOS offers free same-day triage for hacked sites.
Do I need to move my hosting to use Cloudflare?
No. Cloudflare works in front of any host. You only change your domain’s nameservers.
Next step
If you want Cloudflare Pro set up and watched for you, start with Tremhost Armor Guard at $9 a month. If you are also choosing hosting, compare the managed WordPress plans, which include Cloudflare Pro on every site.


