Use code PERFMATTERS for an extra 10% off!
  1. Home
  2. Docs
  3. General
  4. How to enable CDN rewrite in WordPress

How to enable CDN rewrite in WordPress

The CDN rewrite option allows you to easily use third-party CDN providers on your WordPress site. Rewrite means that it will automatically change all of your assets’ URLs on the fly to use the CDN URL. This way, your assets will load from all of the global CDN POPs, instead of just your server.

A few popular CDN providers we recommend include:

If you’re using Cloudflare you don’t need to do anything in Perfmatters. Cloudflare is different than traditional CDN providers and sits between your site and the public internet. Traffic is automatically routed through Cloudflare, and it doesn’t require a custom CDN URL.

Enable CDN rewrite

Follow the steps below to enable CDN rewriting of your URLs.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters plugin settings
Perfmatters plugin settings

Step 2

Under the “Options” tab, click on the “CDN” sub-navigation menu.

Perfmatters CDN
Perfmatters CDN

Step 3

Toggle on “Enable CDN Rewrite.” Note: Make sure to first configure your CDN URL.

Enable CDN rewrite
Enable CDN rewrite

Step 4

Scroll down and click “Save Changes.”

Important: If you’re testing on a staging site, you’ll probably need to turn the CDN rewrite feature off temporarily as the CDN URL will only match your live site.

Was this article helpful?

Related Articles