Loading...

WordPress

How to add a CDN to WordPress: step by step with the CDNTR plugin

You can put your WordPress site on a CDN without moving it. The free CDNTR plugin rewrites your CSS, JavaScript and image URLs to your CDN hostname, connects the site to your cdn.com.tr account in one click and purges the cache by itself when content changes. If you want the whole site, pages included, served through the CDN, you go through DNS; this guide covers both.

8 min read Beginner Updated

How to add a CDN to WordPress: step by step with the CDNTR plugin

Two ways: static files or the whole site

There are two ways to add a CDN to WordPress, and they work together.

Static files with the plugin. The CDNTR plugin rewrites the CSS, JavaScript and image URLs on your pages to your CDN hostname. The page itself (the HTML) still comes from your server, and you do not touch your DNS. Setup takes a few minutes, and the files that make up most of a page's weight come from edge servers close to each visitor.

The whole site with DNS. When you point your domain at the CDN, every request, pages included, goes through the edge servers. The WAF, bot protection and automatic SSL apply to every page, and you decide with rules which paths are cached.

Whichever you start with, the CDNTR plugin brings cache purging into WordPress.

Before you start: a Pull CDN account on cdn.com.tr

Open a new CDN account in the panel and choose Pull CDN as the content source. The origin is the server your WordPress site runs on today, for example https://www.example.com. Our edge servers fetch files from there on the first request and keep them in cache.

Your account gets a CDN hostname. If you like, you also attach a subdomain of your own such as cdn.example.com to the account with a CNAME record, so your file URLs carry your own domain. The steps are in publishing an existing website through the CDN and the delivery hostname.

Install the CDNTR plugin

CDNTR is our free plugin on WordPress.org. In your WordPress admin open Plugins → Add New, search for "CDNTR", press Install Now and then Activate. The plugin ships in seven languages.

Its settings live under Settings → CDNTR, split into tabs: Optimization, Connection, CDN delivery, Images and Warm-up.

Connect your site in one click

On the Connection tab press Connect to CDN.com.tr. Your cdn.com.tr panel opens; you choose which account the site connects to, press Approve and connect and land back in WordPress, connected. It is the same flow as connecting a GitHub or Google account.

The key the site receives can do one thing: clear your cache. It cannot reach your storage, your FTP or your account settings. Connected sites are listed in the panel under CDN → WordPress Connection, and you can revoke any one of them without touching the others.

If your site cannot complete the redirect (a local install or a password-protected site), you can create the key by hand on the same page and paste it into the plugin.

Pick your CDN hostname and save

On the CDN delivery tab, the CDN Hostname field fills in by itself when your account has one CDN hostname; with several, you pick one from the list. Adjust the file extensions to serve from the CDN and any URL fragments to exclude, then save.

From then on, the static files your theme and plugins load are written with your CDN hostname. Nothing else needs to change in your theme or content.

An image URL before and after saving

<!-- before -->
<img src="https://www.example.com/wp-content/uploads/2026/11/product.jpg">

<!-- after -->
<img src="https://cdn.example.com/wp-content/uploads/2026/11/product.jpg">

Purging the cache: by hand and automatically

On a connected site, the purge button in the admin bar clears the whole cache or the paths you choose.

Most of the time you will not need it: when you save or delete a post or page, or change categories and tags, the affected pages are purged by themselves; when you save the Customizer or switch themes, the whole site is. The plugin queues purge requests and merges duplicates. You can do the same from WP-CLI.

How purging works on the edge servers is explained in purging the CDN cache.

Check that it works

The plugin's Optimization tab runs a live test: it shows that your files really come from the edge server, with the cache status (HIT) and the response time. The same screen also checks your object cache, page cache, conflicting CDN plugins, and cache-blocking headers or cookies sent to anonymous visitors.

To check by hand, look at your page source and confirm that image and CSS URLs start with your CDN hostname, then request one file twice. On the second response, X-Proxy-Cache-MT: HIT shows the file came from the edge server's cache.

Seeing a file served from cache
curl -sI https://cdn.example.com/wp-content/themes/theme/style.css | grep -i x-proxy-cache-mt
curl -sI https://cdn.example.com/wp-content/themes/theme/style.css | grep -i x-proxy-cache-mt
# x-proxy-cache-mt: HIT

Serving the whole site through the CDN (with DNS)

If you want your pages served from the edge servers too, add your domain on the Domains tab of Domains & Rules and point your DNS to us: with a CNAME record for www, or by moving your whole DNS to us. The certificate is issued and renewed automatically, and the WAF and bot protection run on every page.

In WordPress, keep paths that carry a session out of the cache: write a "Don't cache this path" rule for /wp-admin, wp-login.php and the cart and checkout pages, and on cached paths skip the cache when the wordpress_logged_in or WooCommerce cart cookies are present. An example rule is in cache rules. If saving in a theme or page builder runs into the WAF, the WordPress example in Read WAF logs walks through the fix.

Keep the CDNTR plugin on this route as well: it purges the affected pages when content changes.

Images and cache warm-up

To serve images as WebP and AVIF, turn on image optimization in the panel: the edge server converts JPEG and PNG images to a format each browser accepts, your image URLs stay the same and nothing runs on your server. The details are in image optimization. The plugin's Images tab shows what you have chosen in the panel.

The Warm-up tab requests your cacheable pages through the CDN ahead of time, after a purge or on a light background schedule, so the first visitor also gets a fast cached response. It skips the cart, checkout, account and search pages.

If you want us to host the site

This guide assumes your site stays on its current server. If you would rather hand the hosting of your WordPress to us as well, managed WordPress hosting runs your site with the CDN and SSL ready; the CDNTR plugin arrives there installed and connected.

How to set it up

Step-by-step guides in the help centre:

WordPress and CDN FAQ

Is the CDNTR plugin paid?

No, the plugin is free. Serving your files from the CDN, purging the cache and converting images at the edge need a cdn.com.tr account.

Will it break my theme or plugins?

No. The plugin only changes the URLs of static files; it does not touch your theme or content. You choose which extensions are served from the CDN and which URLs stay out.

Does it work with WooCommerce?

Yes. With the plugin only CSS, JavaScript and images come from the CDN; cart, checkout and account pages keep coming from your server. When you put the whole site on the CDN with DNS, you write rules that skip the cache for those pages.

Should I remove my page cache plugin?

No. A page cache plugin stores the HTML your server builds, while the CDN serves files from edge servers close to visitors; the two work together. Do turn off any other CDN plugin that rewrites static URLs; the Optimization tab points out such a conflict.

How do I disconnect a site?

Revoke the site's key in the panel under CDN → WordPress Connection; the site can no longer purge the cache. When you deactivate the plugin, file URLs go back to your server.

Is WordPress multisite supported?

Yes, CDNTR works on WordPress multisite networks.