Running a WordPress website means balancing performance, security, and reliability. One of the easiest ways to improve all three is by using Cloudflare — a free content delivery network (CDN) and security platform that sits between your visitors and your web server.
This guide explains how to set up Cloudflare and integrate it with the LiteSpeed Cache plugin to make your website faster and more secure.
Step 1: Add Your Website to Cloudflare
- Visit Cloudflare.com and create a free account.
- Add your domain name (for example, example.com).
- Cloudflare will scan and display your DNS records. Review and confirm them.
- You will receive two Cloudflare nameservers.
- Log in to your domain registrar (such as Namecheap or GoDaddy) and replace your current nameservers with the Cloudflare ones.
Changing your nameservers allows Cloudflare to route, protect, and cache your traffic worldwide.
Step 2: Connect Cloudflare to LiteSpeed Cache
If your hosting provider uses LiteSpeed Web Server, the LiteSpeed Cache plugin can connect directly to Cloudflare.
- In your WordPress dashboard, go to LiteSpeed Cache → CDN → Cloudflare tab.
- Turn on “Use Cloudflare API.”
- Generate an API Token in your Cloudflare account:
- Go to My Profile → API Tokens → Create Token.
- Use the “WordPress” template to set the correct permissions.
- Copy the token into LiteSpeed Cache, along with your Cloudflare email and domain name.
- Save the changes.
LiteSpeed Cache will now automatically clear Cloudflare’s cache whenever you update your site.
Step 3: Recommended Cloudflare Settings
SSL/TLS Mode: Full (Strict) — enables full encryption between visitors and your server.
Auto Minify: JS, CSS, HTML — reduces file size and improves delivery time.
Brotli Compression: ON — compresses text-based files for faster load speed.
Rocket Loader: OFF — prevents JavaScript conflicts with plugins.
Caching Level: Standard — provides balanced caching without over-aggressive behaviour.
Always Use HTTPS: ON — automatically redirects all visitors to the secure HTTPS version.
Step 4: Use Development Mode When Editing
When editing your site’s design or making code changes, turn on Development Mode from the LiteSpeed Cache Cloudflare tab. This temporarily disables Cloudflare caching for three hours, so you can see updates instantly. Cloudflare automatically re-enables caching after this period.
Step 5: Purge Cache After Major Updates
When you make significant updates such as theme changes or plugin installations, clear Cloudflare’s cache.
Go to WordPress → LiteSpeed Cache → CDN → Cloudflare → Purge Everything.
This ensures all visitors see the latest version of your website.
Step 6: Benefits of Using Cloudflare
Once integrated, Cloudflare delivers several advantages:
- Global CDN caching for images, CSS, and JavaScript.
- Protection against DDoS attacks and malicious bots.
- Free SSL certificates with automatic HTTPS enforcement.
- Reduced server load and improved website responsiveness.
Most websites experience up to 1.5× faster load times and greater reliability after enabling Cloudflare.
Summary
Cloudflare provides CDN caching and security at the network level, while LiteSpeed Cache optimises performance at the server level. When used together, they deliver a faster, safer, and more reliable WordPress website without extra cost or complexity.

