Most articles about a CDN for WordPress stop at “it makes your site faster”. This one does not. Below you get the actual clicks: where to change your nameservers, which plugin to install, what to paste in the CDN URL field, how to purge the cache after an update, and how to prove with two commands that your images are really being served from an edge server instead of your origin host.
We also compare the three CDNs people actually shortlist in 2026 (Cloudflare, BunnyCDN and KeyCDN) on setup difficulty and real monthly cost, so you can pick one before you start clicking.
What a CDN actually changes on a WordPress site
A content delivery network stores copies of your static files (images, CSS, JavaScript, fonts, sometimes full HTML pages) on servers spread around the world. When a visitor in Montreal, Paris or Singapore loads your site, those files come from the closest edge server instead of travelling from your single hosting server.
Concretely, on a typical WordPress site you should expect:
- Lower latency for visitors far from your host, often 100 to 400 ms saved on each asset request.
- Less load on your origin server, because 80 to 95% of requests never reach it.
- Better Largest Contentful Paint when your LCP element is an image (hero banners, featured images).
- Some protection against traffic spikes and basic bot floods.
What a CDN does not fix: slow database queries, a bloated theme, 40 plugins, or an unoptimised WooCommerce cart page. A CDN is a layer on top of a well-built site, not a replacement for one.

Before you start: a 5-minute checklist
- Take a full backup (files + database). UpdraftPlus, your host’s snapshot tool, whatever you use.
- Know where your DNS is managed: at your registrar (GoDaddy, Namecheap, OVH…) or at your host. You will need login access.
- Make sure HTTPS already works on your origin domain. Adding a CDN on top of a broken SSL setup creates redirect loops.
- Record a baseline: run your homepage and one product/article page through WebPageTest or PageSpeed Insights and save the numbers. Without a baseline you cannot prove the CDN helped.
- Note your current page cache plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache). You will connect it to the CDN rather than replace it.
Cloudflare vs BunnyCDN vs KeyCDN: setup and cost compared
The three work very differently. Cloudflare sits in front of your entire domain (you change nameservers). BunnyCDN and KeyCDN create a separate hostname for assets (a “pull zone”) and your plugin rewrites URLs to it. That single difference drives everything else.
| Cloudflare | BunnyCDN (bunny.net) | KeyCDN | |
|---|---|---|---|
| Setup method | Change nameservers at your registrar (full DNS migration) | Create a pull zone + install the official plugin (no DNS change required) | Create a pull zone + CDN Enabler plugin (no DNS change required) |
| Time to live traffic | 15 min of work, up to 24 h for nameserver propagation | 10 to 15 min, instant | 10 to 15 min, instant |
| Free tier | Yes, genuinely unlimited bandwidth | No, but trial credit and ~$1/month minimum | No, free trial then pay as you go |
| Typical pricing | Free / Pro around $25 per month / Business around $200 per month | From about $0.01/GB (volume network) to $0.03-$0.06/GB (standard tier), monthly minimum around $1 | From about $0.04/GB in Europe and North America, monthly minimum around $4 |
| Image optimisation / WebP | Polish and Image Resizing on paid plans | Bunny Optimizer add-on, around $9.5 per month per zone | Image processing available, billed per operation |
| HTML page caching | Yes via APO (included on Pro, around $5 per month standalone) | Yes, via Perma-Cache / edge rules, manual setup | Not really, asset delivery focused |
| Official WordPress plugin | Yes | Yes (bunny.net CDN, 1-click zone creation) | Yes (CDN Enabler, maintained by KeyCDN) |
| Also gives you | WAF, DDoS protection, DNS, free SSL, bot rules | Object storage, video streaming, DNS, edge scripting | Clean logs, real-time reports, simple API |
| Best for | Blogs and business sites that want free speed + security in one move | Image-heavy sites, media libraries, best price/performance ratio | Developers who want predictable, boring, reliable asset delivery |
Prices are indicative for September 2026 and change regularly. Always confirm on the provider’s pricing page before committing.
What it really costs: three concrete scenarios
Bandwidth is what you pay for. To estimate yours: open your hosting panel statistics (or Google Analytics pageviews x average page weight) and take the monthly total.
| Scenario | Monthly CDN traffic | Cloudflare | BunnyCDN | KeyCDN |
|---|---|---|---|---|
| Small local business site, 15k pageviews | ~25 GB | $0 | ~$1 (minimum) | ~$4 (minimum) |
| Content blog, 150k pageviews | ~250 GB | $0 (or $5 with APO) | ~$3 to $8 | ~$10 |
| WooCommerce store with large product images | ~1.5 TB | $0 to $25 (Pro for Polish + WAF) | ~$18 to $45 + $9.5 Optimizer | ~$60 |
Which one should you pick?
- Pick Cloudflare if your budget is zero, you want a firewall and DDoS protection at the same time, and you are comfortable moving your DNS. This is the right default for 80% of WordPress sites.
- Pick BunnyCDN if your site is image or media heavy, you want WebP/AVIF conversion without a plugin bloating your server, and you do not want to touch nameservers. Best value per GB in this comparison.
- Pick KeyCDN if you want the simplest possible “assets only” CDN, clean logs, and no ecosystem lock-in. Slightly more expensive per GB, extremely predictable.
You can also combine: Cloudflare in front for DNS, SSL and security, plus Bunny or KeyCDN for the media library. That is a common setup on large sites, though it adds a moving part.

Method 1: Set up Cloudflare CDN for WordPress (nameserver route)
Step 1: Create the account and add your site
- Sign up at cloudflare.com and click Add a site.
- Enter your domain without www (example.com) and choose the Free plan.
- Cloudflare scans your existing DNS records. Check them carefully against your current DNS zone: A records, MX records for email, TXT records for SPF/DKIM, and any subdomain used by your mail or CRM. Missing an MX record here is the number one way people break their email during a CDN migration.
- Add anything missing manually, then continue.
Step 2: Set proxy status correctly
In the DNS tab, each record has a cloud icon:
- Orange cloud (proxied): traffic goes through Cloudflare. Set this on your root domain
@and onwww. - Grey cloud (DNS only): traffic goes straight to the IP. Keep this for
mail,ftp,cpanel,webmailand any record used by email.
Step 3: Change nameservers at your registrar
- Cloudflare gives you two nameservers, something like
dana.ns.cloudflare.comandrex.ns.cloudflare.com. - Log into your domain registrar (not your host, unless they are the same), open the domain settings, find “Nameservers” or “DNS management”, choose “Custom nameservers” and replace the existing ones.
- Save. Propagation is usually 5 minutes to 2 hours, officially up to 24 hours.
- Wait for the Cloudflare dashboard to show Active.
Step 4: Configure SSL and caching properly
This is where sites break, so follow exactly:
- SSL/TLS > Overview: set encryption mode to Full (strict) if your origin has a valid certificate. Never use “Flexible” on a site that already has HTTPS, it causes redirect loops.
- SSL/TLS > Edge Certificates: enable Always Use HTTPS and Automatic HTTPS Rewrites.
- Caching > Configuration: Caching Level = Standard, Browser Cache TTL = 1 month or higher.
- Speed > Optimization: enable Brotli. Be careful with JS/CSS minification if your cache plugin already does it, doing it twice is the classic source of broken layouts.
Step 5: Install the Cloudflare plugin in WordPress
- In WordPress: Plugins > Add New, search “Cloudflare”, install and activate the official plugin.
- Open Settings > Cloudflare and sign in with your email + API token (create it in Cloudflare under My Profile > API Tokens, using the “WordPress” template).
- Click Apply default settings. This configures a WordPress-friendly ruleset in one click.
- Enable Automatic Cache Management so the edge cache purges when you publish or update content.
Step 6 (optional but powerful): enable APO
Automatic Platform Optimization caches your HTML at the edge, not just images and CSS. On a shared host, this is usually the single biggest speed jump you will get. It is included on Pro plans, or roughly $5 per month on the Free plan. Enable it from the plugin screen, and make sure logged-in users and WooCommerce cart/checkout pages are excluded (APO handles WordPress cookies automatically, but test with a real order before trusting it).
Method 2: Set up BunnyCDN for WordPress (pull zone route)
No nameserver change needed. Your HTML still comes from your host, but every asset URL is rewritten to a Bunny hostname.
Step 1: Create a pull zone
- Create an account at bunny.net and add a small credit balance.
- Go to CDN > Add Pull Zone.
- Name: something like
mysite. This gives youmysite.b-cdn.net. - Origin URL: your full site URL, for example
https://example.com. - Pricing zones: enable Europe + North America at minimum. Add Asia, South America and Africa if you have traffic there (they cost more per GB, so enable based on your analytics).
- Click Add Pull Zone.
Step 2: Add a custom CDN hostname (recommended)
Serving assets from cdn.example.com instead of mysite.b-cdn.net keeps your branding and makes it painless to switch providers later.
- In your DNS, create a CNAME:
cdnpointing tomysite.b-cdn.net. - In the pull zone, open Hostnames, add
cdn.example.com. - Click Load Free SSL Certificate and wait for it to turn green.
- Enable Force SSL.
Step 3: Connect WordPress
- Install the official bunny.net CDN plugin from the WordPress repository.
- Enter your API key (Bunny dashboard > Account > API).
- Select your pull zone, or let the plugin create one automatically if you skipped steps 1 and 2.
- Set the CDN hostname to
cdn.example.com. - Check the file extensions to be rewritten. The default list (jpg, jpeg, png, webp, gif, svg, css, js, woff, woff2, mp4, pdf) covers almost everything.
- Exclude anything you do not want on the CDN, typically
/wp-admin/and any dynamic PHP endpoint. - Save and enable the CDN.
Step 4: Recommended pull zone settings for WordPress
- Caching > Cache Expiration Time: Respect origin headers, or set 1 month if your host sends no cache headers.
- Query string sorting: enabled (better hit ratio).
- Strip response cookies: enabled for static assets.
- Optimizer (paid add-on): enable automatic WebP/AVIF and dynamic image resizing if you serve lots of photos.
- Enable CORS headers: important if you serve web fonts from the CDN hostname.
Method 3: Set up KeyCDN for WordPress
Step 1: Create the zone
- Sign up at keycdn.com and start the free trial.
- Go to Zones > Add Zone.
- Zone name: for example
mysite. - Zone type: Pull.
- Origin URL:
https://example.com. - Under advanced features, enable Let’s Encrypt SSL, Gzip/Brotli and CORS if you use custom fonts.
- Save. You now have
mysite-xxxx.kxcdn.com.
Step 2: Add a zone alias
- Create a CNAME in your DNS:
cdnpointing tomysite-xxxx.kxcdn.com. - In KeyCDN, go to Zonealiases > Add Zonealias, enter
cdn.example.comand attach it to your zone. - Enable the Let’s Encrypt certificate for that alias.
Step 3: Install CDN Enabler
- Install the CDN Enabler plugin (maintained by KeyCDN) from the WordPress repository.
- Go to Settings > CDN Enabler.
- CDN URL:
https://cdn.example.com. - Included directories:
wp-content,wp-includes. - Exclusions:
.phpand anything dynamic. - Tick Enable CDN for relative paths, save changes.
If you use WP Rocket, LiteSpeed Cache or W3 Total Cache, you can skip CDN Enabler entirely and paste the CDN hostname into the CDN section of those plugins instead. Never run two URL rewriters at the same time.

Verify that your assets are really served from the edge
Do not trust the plugin’s green checkmark. Verify it yourself with three quick checks. infiniteuploads.com has covered this at length.
Check 1: view source
Open your homepage, right click, View page source, and search for wp-content/uploads. With Bunny or KeyCDN the URLs must start with https://cdn.example.com/. With Cloudflare the URLs stay on your own domain (that is normal, Cloudflare proxies the whole domain).
Check 2: browser DevTools
- Press F12, open the Network tab, hard refresh with Ctrl+F5.
- Click an image request and look at Response Headers.
Here is what a working setup looks like:
| CDN | Header to look for | Good value |
|---|---|---|
| Cloudflare | cf-cache-status, cf-ray, server |
HIT (MISS on first load is normal), server: cloudflare |
| BunnyCDN | cdn-cache, cdn-pullzone, server |
cdn-cache: HIT, server: BunnyCDN-... |
| KeyCDN | x-cache, x-edge-location, server |
x-cache: HIT, server: keycdn-engine |
Check 3: the terminal (fastest method)
Run this against any image on your site:
curl -I https://cdn.example.com/wp-content/uploads/2026/09/hero.jpg
Run it twice. The first response may say MISS (the edge is fetching from origin), the second must say HIT. If the second call still says MISS, your cache expiration is set to 0 or your origin is sending Cache-Control: no-cache. There’s a good explainer over at wpbeginner.com.
Check 4: test from another continent
Use a global speed test tool (KeyCDN’s Performance Test, GTmetrix with multiple locations, or Uptrends). Compare TTFB from 5 or 6 cities before and after. That is the number that should have dropped, and it is the one worth screenshotting for your client or your boss.
How to purge the CDN cache (and when you must)
Every WordPress user hits this eventually: you update the logo or a CSS file, and the old version keeps showing. The edge is still serving the cached copy.
When to purge
- After a theme or child-theme CSS/JS edit
- After replacing a media file with the same filename
- After a plugin or core update that changes asset files
- After changing your page cache settings
How to purge, per provider
- Cloudflare: dashboard > Caching > Configuration > Purge Cache. Prefer Purge by URL; use Purge Everything sparingly because it forces your origin to serve everything again. The official plugin also purges automatically on post update.
- BunnyCDN: pull zone > Purge Cache button, or the “Purge Cache” button the plugin adds to your WordPress admin bar. Single-file purge is available via the URL purge tool.
- KeyCDN: Zones > Purge, or purge a single file from Zone > Purge URL. CDN Enabler does not purge automatically, so bookmark this page.
The better long-term fix: use versioned filenames. Most cache plugins append ?ver=1.2.3 to CSS and JS. When you edit a file, bump the version and the edge treats it as a brand new object. No purge needed.

Common problems and how to fix them
Fonts do not load / CORS errors in the console
Web fonts served from a different hostname require CORS headers. Enable “CORS headers” in the Bunny pull zone or the KeyCDN zone settings. On Cloudflare this does not happen since the hostname does not change.
Mixed content warnings
Some asset is still being called over HTTP. Enable Automatic HTTPS Rewrites on Cloudflare, or run a search-replace on your database (Better Search Replace plugin) from http://example.com to https://example.com.
Logged-in users see cached pages, or WooCommerce carts get mixed up
Only an HTML-caching CDN can cause this. Exclude /cart/, /checkout/, /my-account/ and any URL containing wp-admin from edge caching, and confirm that your setup bypasses cache when the wordpress_logged_in_ cookie is present.
The admin area became slow
Do not run wp-admin through aggressive optimisation. Exclude it from minification and rocket-loader style features.
Images are broken after enabling the CDN
Usually the origin URL in the pull zone is wrong (http instead of https, or www vs non-www mismatch). Open the raw CDN URL of one image directly in a browser tab and read the error message.
Bandwidth bill higher than expected
Check your hotlink protection settings, and verify that huge original images are not being served where thumbnails should be. Enabling WebP/AVIF conversion typically cuts image bandwidth by 25 to 50%.
Pair your CDN with a page cache plugin
A CDN handles distance. A page cache plugin handles PHP and database work. You want both. This reference is the one worth keeping handy.
- Configure the page cache plugin first (WP Rocket, LiteSpeed Cache if you are on LiteSpeed hosting, or the free WP Super Cache).
- Then add the CDN hostname in that plugin’s CDN tab (for Bunny/KeyCDN) or install the Cloudflare plugin.
- Make sure only one tool is doing minification, one is doing lazy loading, and one is rewriting URLs.
- Re-run PageSpeed Insights and compare against the baseline you saved at the start.
FAQ
Which CDN is best for WordPress?
For most sites, Cloudflare is the best starting point because the free plan includes unlimited bandwidth, SSL and a firewall. If your site is image or video heavy, BunnyCDN usually delivers better performance per dollar. KeyCDN is the pick when you want a simple, predictable, asset-only CDN without a wider platform attached.
Is there a genuinely free CDN for WordPress?
Yes. Cloudflare’s Free plan is the only major CDN with no bandwidth cap, and it works fine on production sites. Jetpack also offers a free image CDN (Photon/Site Accelerator) if you only care about media files. BunnyCDN and KeyCDN are paid, though small sites often pay only the monthly minimum of a few dollars.
Do I need a CDN if my hosting already has one?
Many managed WordPress hosts (Kinsta, WP Engine, Cloudways, Rocket.net and others) bundle an edge network. If yours does, test it first. Adding a second CDN on top rarely helps and often complicates cache purging.
Does a CDN improve SEO?
Indirectly, yes. Faster loading improves Core Web Vitals, which are part of Google’s page experience signals, and it reduces bounce on mobile connections. A CDN alone will not rank a thin page, but it removes a real technical handicap on international traffic.
Will a CDN break my WooCommerce store?
Not if you only cache static assets. Problems appear when HTML caching is applied to cart, checkout and account pages. Exclude those URLs, test a full purchase flow in a private window, and you are safe.
How long does the setup take?
Around 10 to 15 minutes of actual work for BunnyCDN or KeyCDN, and 15 minutes plus DNS propagation for Cloudflare. Budget an extra 30 minutes for testing and fixing font or mixed-content warnings.
Do I still need image optimisation plugins?
If your CDN converts to WebP or AVIF at the edge (Bunny Optimizer, Cloudflare Polish), you can drop the server-side compression plugin. You should still upload correctly sized images: no CDN can undo a 4000 px photo used in a 400 px slot.
Final recommendation
Start with Cloudflare Free and the official plugin. Measure. If your images are still the bottleneck, or your audience is spread across continents, move your media to BunnyCDN with the Optimizer enabled and keep Cloudflare for DNS and security. Choose KeyCDN if you value simplicity and clean reporting above all. In every case, verify with curl -I that you are getting a cache HIT, and never skip the backup before you touch DNS.
Need help auditing your WordPress performance or configuring a CDN without breaking your store? Get in touch with our team and we will handle the setup and the verification for you.
