How to setup CloudFlare CDN in WordPress to speed up your website

How to use Cloudflare in WordPress to speed up your website

I’ve recently setup Amazon CloudFront as a CDN (Content Delivery Network) for one of my domains (running on WordPress) and I’ve seen an improvement in the sites load speed of that specific site since doing so.

Of late, I’ve been hearing and reading some good things about the CloudFlare CDN offering and so I decided to use another of my domains (also running on WordPress) to test this service.

For the purposes of this “How to” post, I’ll be signing up for a free CloudFlare account.

This plan promises to increase the performance of my site, improve the sites security protection, provide stats about my site visitors and lets not forget that it’s FREE

If you’d like to the same, below are the rough step-by-step instructions on how you too can get started in implementing a CloudFlare CDN to speed up your WordPress powered website. These steps from start to finish shouldn’t take you longer than 15 – 20 minutes. 

CloudFlare CDN in WordPress: Getting Started

1. Sign up for the free CloudFlare account.

2. Provide your email address, pick your username and specify your password and then click on “Sign up CloudFlare” to proceed. 

3. Add your first website by specifying your domain name and then clicking on the “Add this domain” button.

4. CloudFlare will begin scanning your domains DNS setup before continuing to the next step – during this time you’ll be able to watch a short video on how CloudFlare works. 

5. Once CloudFlare has finished scanning your setup, click the “Continue to Step 2” button to proceed.

6. CloudFlare needs a copy of your entire DNS zone file and will present all the records it has found, while allowing you to add any which they may have missed. Confirm that all the records it has found are correct and then click the “I’m done checking my DNS records, continue” button. 

7. CloudFlare will have copied your DNS records to the CloudFlare infrastructure. If you use SSL there will be one more step you’ll have to complete, otherwise just click the “My settings look good, continue” button. 

8. The final step will involve you changing your name servers at your host or domain name registrar to the CloudFlare name servers which they provide you.

In my particular case, Heart Internet is my domain name registrar so I logged into my control panel, and edited my name server records. Once I changed my name servers at my registrar, I clicked on the “I’ve updated my name servers, continue” button.

9. If your name severs have successfully changed, you’ll be taken to the “Websites” tab in your profile which will display the domain you’ve just added to CloudFlare as well as some optional setup steps, of which one of those are to install the CloudFlare WordPress plugin. 

For the purposes of this “How to” we’re going to grab the CloudFlare WordPress plugin to install on our WordPress powered site (and I’ll assume you know how to install a WordPress plugin but I’ll go into more detail on configuring the plugin further on down the page).

10. When you’ve just setup your free CloudFlare account, you’ll not see any data in the Analytics section of your dashboard. For paid for accounts, this data is updated every 15 minutes. 

The threat control dashboard will also not have any data to report on straight after setup.

11. You’ll need your CloudFlare API key to configure the CloudFlare plugin for WordPress and you’ll be able to get this from the “Account” tab in your CloudFlare account profile. Copy and paste it into a text document or straight into the plugin once you’ve installed it.

12. On the WordPress site that I am testing the CloudFlare CDN on, I have got the W3 Total Cache plugin installed as well as the Google Page Speed API to monitor my sites page speed as well as to let me know where I should be making improvements. 

Prior to installing CloudFlare, the Google Page Speed API report gave my site a score of 82/100 – which isn’t too bad as is – but I’m keen on seeing what sort of boost I’ll get straight after setting up CloudFlare.  

There are several other areas I know I need to tackle to improve that score but for now I’m specifically focussing on how the score above will change after setting up CloudFlare.

13. After you’ve installed the CloudFlare plugin in WordPress, click on the CloudFlare link in your Plugins section.

Include your CloudFlare API key – available from the “Account” section of your CloudFlare dashboard – and API email into the CloudFlare settings page and then click on “Update options”. 

14. If the settings you input above are correct, you’ll get a green confirmation on the CloudFlare settings page as shown below. 

You have the option of optimising your database to make your site faster – in my case, I ran the optimiser. 

15. In the configuration section of your WordPress sites W3 Total Cache plugin under the General settings option, enable CloudFlare and add your registered email address, your CloudFlare API key and for which domain. You can also set your domains security level and in this case I’ve set it to “Medium”. Once you’ve done that click on the “Save all settings” button. 

16. Straight after configuring CloudFlare as my CDN through W3 Total Cache, the domains Google Page Speed score improved by 3 points. 

That’s all you need to do in order to start using CloudFlare on your WordPress powered site to improve your site speed. You can also read some of CloudFlares top tips after having setup its service.

I’ll be monitoring CloudFlare over the next few weeks and I’ll write a new blog post soon with my findings.

Are you using CloudFlare as a CDN? What do you think of its service? Let me know.

The following two tabs change content below.

Pedro Da Silva

Online Marketing Junkie

My name is Pedro Da Silva. I have built-up a wide range of digital marketing skills over the last 15 years working in the web industry. From front-end web design and graphics, to SEO and online marketing. I'm creative, commercial and technically minded. South African born & bred, I work in the UK online marketing industry. I'm a proud dad & husband that loves music, photography and mixed martial arts.

3 Responses to How to setup CloudFlare CDN in WordPress to speed up your website
  1. Gilbert Reply

    Well broken down Mister Da Silva. Really helpful and i appreciate the Cloudflare guide.

  2. Christopher J Reply

    It helps me a lot! I must thank you! Now, my website runs on cloudflare CDN! Thanks a lot!

  3. [...] How to setup CloudFlare in WordPress to speed up your website by Pedro Da Silva [...]...

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.