> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://krystal-dev.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to configure WordPress to use a CDN

This guide assumes you've purchased a [Krystal CDN](https://krystal.uk/cdn) and if required [set up a custom hostname](/cdn/default-and-custom-cdn-hostname).

This guide shows the CDN set up as a custom hostname. If you've not followed our guide to [set up a custom hostname](/cdn/default-and-custom-cdn-hostname) you should use the default CDN name ending `b-cdn.net`.

It also assumes that you're WordPress site is using the [LiteSpeed caching plugin](https://krystal.help/wordpress/how-to-install-the-wordpress-litespeed-cache-plugin).

It's also important that you've fully optimised your site before adding the CDN. We have a separate guide on [optimising your WordPress site](https://krystal.help/wordpress/how-to-optimise-your-word-press-site) and we strongly advise running through that first - many of the tips also apply to sites not running WordPress, or using a different CDN.

1.  From within your WordPress dashboard select, **LiteSpeed Cache > Settings**.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/5e407d56a3d8b000/1cbf2729-3185-439f-a8f6-1016fe_1a4labw.jpeg)
    
2.  Click **Show Advanced Options** to show the CDN tab.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/ce9f745d6a345000/8ed1b485-cb82-478d-aea9-814a59_1vb28hc.jpeg)
    
3.  Toggle the **Enable CDN** slider to **On**  
    Enter the **CDN URL** (the hostname you set up) including the initial `https://`  
    Enter the site's **Original URL**, prefixed by `//`
4.  By default, the CDN will cache Images, CSS and JS.  
    You can alter what is cached to suite your specific requirements - adding or removing files, including directories or excluding paths.
5.  Click the **Save Changes** button at the top or bottom once you've entered all the required details.
6.  Purge your site's LiteSpeed cache - hover over the LiteSpeed icon in the WordPress Admin bar and select **Purge All** from the menu that appears.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/e3082b2bbe2f3800/36fc2dc7-83b2-4fcc-bd46-c3d951_1s7pz3z.jpeg)
    
7.  You should now be able to visit your site and see the selected resources being served from the CDN in your browser console.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/8bfa4430c97e8000/aee5c627-3221-4a56-881b-fe8a5c_12lrik6.jpeg)
    

* * *

* * *