Cloudflare sits between your visitors and your web server. It can make your site faster, block malicious traffic and keep it online during traffic spikes, and the free plan is enough for most small business sites.
This guide explains what Cloudflare does and how to set it up safely.
What Does Cloudflare Do?
- DNS hosting: fast, reliable name servers for your domain.
- CDN and caching: serves static files from locations close to visitors.
- SSL: encrypts traffic between visitors and your site.
- Firewall: blocks bad bots, attacks and suspicious requests.
- DDoS protection: absorbs floods of fake traffic.
Before You Start
- Take a full backup of your site. See our website backup strategy.
- Note all your current DNS records, especially email records.
- Make sure your site already works over HTTPS.
Step-by-Step Setup
1. Add Your Domain
Create a free Cloudflare account, add your domain and choose a plan. Cloudflare scans your existing DNS records.
2. Check the DNS Records
Compare the imported records with your old ones. Make sure A, CNAME, MX and TXT records are all present, or email may stop working.
3. Change the Name Servers
At your domain registrar, replace the name servers with the two Cloudflare gives you. Propagation can take a few hours.
4. Set SSL to Full (Strict)
Use Full (Strict) when your server has a valid certificate. Avoid “Flexible”, which can cause redirect loops.
5. Turn On Caching and Speed Features
Enable Auto Minify and Brotli compression, and set a sensible browser cache time. Add a cache rule to bypass the cache for admin and checkout pages.
6. Add Firewall Rules
Turn on bot protection and add rules to challenge traffic to login pages. This pairs well with our guide to hardening a WordPress site.
Common Cloudflare Problems
- Too many redirects: usually an SSL mode mismatch.
- Changes not showing: purge the cache after updates.
- Email stopped: mail records must be set to DNS only, not proxied.
- Real visitor IPs missing: restore them with the right server settings.
Does Cloudflare Improve Speed?
For most sites it improves load times for visitors far from your server. It works best alongside good hosting and optimised code. See our tips on website performance optimization.
Frequently Asked Questions
Is Cloudflare free?
Yes, there is a free plan with a CDN, SSL and basic protection. Paid plans add advanced features.
Will Cloudflare affect my SEO?
When set up correctly it helps, because faster pages and HTTPS are positive signals.
Can I use Cloudflare with WordPress?
Yes. It works well with WordPress and many caching plugins.