Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Setup CloudFlare Free CDN in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Setup CloudFlare Free CDN in WordPress

Page speed is a crucial element in determining your website’s search engine rankings. Not to mention, slow websites lead to a bad user experience. We are often asked by our users how does WPBeginner load so fast. The answer is simple, we use W3 Total Cache and MaxCDN. However, some of our users told us they can not afford MaxCDN. In this article, we will show you how to set up CloudFlare’s FREE CDN in WordPress.

What is CloudFlare?

CloudFlare is basically a Web Application Firewall, a distributed proxy server, and a content delivery network (CDN). It optimizes your website by acting as a proxy between visitors and your server which helps protecting your website against DDoS attacks.

They offer a free basic plan suitable for small websites and blogs. They also offer paid plans starting with $20 per month.

CloudFlare Analytics

What is The Difference Between MaxCDN and CloudFlare

MaxCDN and CloudFlare are both quite different services actually. While MaxCDN is focused on serving your content through their CDN, CloudFlare is more focused on security and spam control.

They both use different technologies to serve content through their networks. MaxCDN serves content from your site’s DNS using pullzones. CloudFlare on the other hand serves content through their own DNS, and you are asked to change your site’s DNS to point to their servers.

CloudFlare acts as a proxy between you and your site’s visitors which means you give up a lot of control, while MaxCDN acts as a reverse proxy which means you have all the control.

CloudFlare is better at optimizing your page speeds by preventing your site from malicious bots, attackers, and suspicious crawlers. MaxCDN is better at improving your speeds by serving your static content through their servers located around the world.

Cons of Using CloudFlare

Users testing CloudFlare have reported that even though it helps the page load times, the difference is not significant.

There are also complaints from users that CloudFlare blocks some of their legitimate visitors from accessing their website. Instead it displays a captcha page to the visitors to prove that they are legitimate users. This creates a bad experience for first time visitors who may never visit the site again.

How to Setup CloudFlare for Your WordPress Site

Before you implement CloudFlare to improve your website’s speed please make sure that it is not your web host that is slowing you down. If you think that it might be your web host, then perhaps you should first consider switching to a better WordPress hosting provider. If you are going to use CloudFlare, then we would recommend BlueHost. They are one of the official CloudFlare partners and one of the official WordPress recommended hosting providers.

To setup CloudFlare, the first thing you need to do is to signup for an account. Visit CloudFlare website and click on the Signup link.

CloudFlare Signup Form

Provide the information required, and then click on the ‘Create account now’ button. In the next step, enter your website’s url.

CloudFlare Add Your Website

CloudFlare will now scan your website. This will take around 60 seconds and during this time you are shown an informational video about how CloudFlare works, and how you would proceed with the setup. We recommend that you watch this video. Once the scan is finished, you need to click on the continue button to proceed with the setup.

CloudFlare Setup Scan

After the scan, CloudFlare will show you a list of all DNS records their systems found. This will include your subdomains as well. The DNS records you want to be passed through CloudFlare will have orange cloud icon. The DNS records that will bypass CloudFlare will have a gray cloud icon. You need to review the list to make sure that your main domain, www subdomain are active on CloudFlare with an orange cloud icon.

Configure your DNS Records

CloudFlare will also add FTP and SSH subdomains for you. If you used your domain name to connect to FTP or SSH, then from now on you will use for FTP, and for SSH. . The new subdomains will not pass through CloudFlare.

If you have any subdomains that you would like to pass through CloudFlare, then you can set them up here.

Once you are satisfied with the DNS records, you need to click on ‘I’ve added all missing records, continue’ button to proceed with the setup.

Choose a plan for your CloudFlare Service

On the next screen, you will be asked to choose a plan, performance and security settings.

If you use SSL on your website, then it is important to remember that SSL will not work with the FREE CloudFlare service. Leave rest of the options to their default settings and click on the continue button to proceed.

On the next and the final step of your setup, CloudFlare will ask you to update your nameservers. You will be asked to change your name servers and point them to CloudFlare nameservers.

Changing Name Servers to CloundFlare

Notice: Changing name server can take some time to propagate through all over the internet. It is possible that during this time your website may become inaccessible for some users.

To change name servers for your domain and point to the CloudFlare name servers, you need to log into your hosting account. Since most web hosts provide cPanel to manage hosting accounts, we will provide you instructions on how to change your name servers using cPanel. However, if your web host does not have cPanel, then you should ask them for instructions.

Once you are logged on to your cPanel dashboard, scroll down to Domains section and click on the Domain Manager.

cPanel Domain Manager

On the next screen, you will be asked to choose the domain name you want to edit. Once you select the domain name you want to edit, you will be shown available editing options for that domain. You need to click on the Name Servers tab.

Changing your name servers

You need to select Use Custom NameServers and enter the nameservers provided by CloudFlare in the boxes below.

After that you need to go back to CloudFlare set up page, and click on the button labeled ‘I’ve updated my nameservers, continue’ to finish the setup.

That’s all, your website is now served and optimized by CloudFlare.

Note: the above screenshots are from the Bluehost account. Your nameserver settings may be different if you’re using a different hosting provider.

We hope this article helped you add CloudFlare’s FREE CDN service to your WordPress site. If you liked this article, then consider subscribing to our YouTube Channel.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Iain says:

    Just to let you know
    I have had a joomla website working on the Free plan and SSL
    Not sure if your previous post is now outdated but it is possible.

    • Mircea Pop says:

      You can use the provided Cloudflare SSL but you are unable to use your own SSL on free account

  2. koushil says:

    bro can we use this for blogspot blog ?

  3. Ikechukwu says:

    This was very helpful. Thanks.

  4. munetsi says:

    i am actually caught in between-
    which provider should i choose for my site,
    between cloudfare or maxcdn

  5. SOTHEA says:

    This is truly awesome tip. Anyways, I have a question. If my website contents and domain name are hosted in different hosting companies. In this case, I need to change Name Servers to CloundFlare for both. Am I correct?

    • Anubhav says:

      Did you find the solution for this as i have different hosting provider and domain name provider is different .If you know the solution then please let me know

  6. Ummi Mental says:

    after changing the DNS, who is actually will my hosting provider? The hoster OR cloudflare and all editing can be done by same cpanel?

  7. Captain Asif says:

    Really very helpful article i have setup my wordpress site with cloudflare

  8. Joe says:

    What minification services do you recommend that work well with Cloudfare? This is for a WordPress site that may have potentially high traffic spikes out of the blue. Thanks

  9. bobzyouruncle says:

    I live at the bottom of Africa (Cape Town) with none of their servers close to me am I correct in thinking that Cloud Flare will slow down my website. Most of my traffic is local. I have the same issues with CDNs none of them are close to my location, Europe is the closest. Is my thinking correct?

    • Damon Billian says:

      CloudFlare would add a little latency because we currently don’t have any data centers in SA just yet (being looked at). Visitors from SA would currently hit a data center in Europe.

      On the other hand, if you have visitors from a lot of other locations (EU, America, Asia, etc.), then the site would be faster for them.

    • munetsi says:

      was just checking ,looks like they have servers in johannesburg.

  10. Adesanmi Adedotun says:

    I have heard about cloudflare but have not tried to make use of it, bout talking about the fact that my site might be down during the propagation of my name server,how long could this take?

  11. Robby McCullough says:

    I am a huge fan of CloudFlare. At my shop, we do a lot of sites for professional photographers. CF does an amazing job at making image heavy pages load in a snap!

    One tip, don’t forget about CF’s developer mode when you’re making changes. I’ve bashed my head against the wall for some time when my CSS changes weren’t showing up — CF was serving a cached page!

  12. Boby says:

    When my website has ‘heavy load’ CloudFlare will make the users access screenshot of the website.

  13. Abhisek says:

    Cloudflare breaks my site’s design. I have a off-canvas menu and Cloudflare’s rocketloader and minification breaks ,y site’s design. So, I have to stick with basic W3 Total cache. Besides Cloudflare actually speeds up your site.

    • Damon Billian says:

      Those features are actually optional and easy to turn off. If you’re using a minify service already, then you don’t want to turn ours on as well (something eventually will break running two minify options at the same time). Rocket Loader would have the potential to impact JavaScript and jQuery & would generally impact something like widgets.

    • Joe says:

      What WordPress theme were you using? That way we can know to avoid using that theme with Cloudfare.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.