What is Cloudflare?
Cloudflare is a global network that sits between your visitors and your web server, providing CDN caching, DDoS protection, SSL, and performance optimization — with a generous free tier.
Setting Up Cloudflare
Step 1: Create an Account
Visit cloudflare.com and sign up. The free plan covers most needs.
Step 2: Add Your Site
Enter your domain name. Cloudflare scans your existing DNS records automatically.
Step 3: Review DNS Records
Verify all DNS records were imported correctly. Key records:
- A record — points to your server IP
- CNAME — for www and subdomains
- MX records — for email delivery
Ensure MX records are NOT proxied (orange cloud). Email must connect directly to your server.
Step 4: Change Nameservers
Update your domain's nameservers at your registrar to the Cloudflare-assigned nameservers. This typically takes 24-48 hours to propagate.
Step 5: Configure SSL
- Set SSL mode to Full (Strict) if your origin has a valid SSL certificate
- Enable Always Use HTTPS
- Enable Automatic HTTPS Rewrites
Recommended Settings
Speed
- Auto Minify: Enable for HTML, CSS, and JavaScript
- Brotli: Enable
- Early Hints: Enable
- HTTP/3: Enable
Caching
- Browser Cache TTL: 1 month
- Always Online: Enable (shows cached pages when your server is down)
Security
- Security Level: Medium
- Bot Fight Mode: Enable
- Challenge Passage: 30 minutes
Page Rules (3 free)
1. *yourdomain.com/wp-admin/* → Security Level: High, Cache Level: Bypass
2. *yourdomain.com/wp-login.php → Security Level: High
3. *yourdomain.com/*.jpg → Cache Level: Cache Everything, Edge TTL: 1 monthCommon Issues
| Issue | Solution |
|---|---|
| Redirect loop | Set SSL to Full (Strict), not Flexible |
| Email not working | Ensure MX records are DNS-only (gray cloud) |
| Admin login issues | Whitelist your IP in Firewall rules |
| Slow after enabling | Purge cache, check page rules |
Conclusion
Cloudflare is the easiest way to improve your website's security and performance. The free tier alone provides significant benefits. Set it up once and enjoy ongoing protection and speed improvements.