How to Setup CloudFlare CDN for WordPress Blog

Using a Content Delivery Network is one of the best ways to reduce page loading time. There are numerous options to choose from, but Cloudflare stands out among the rest due to its exceptional service, all for free. Keep scrolling to learn how to set up Cloudflare on WordPress.
What is Cloudflare CDN?
Cloudflare is a Content Delivery Network (CDN) that acts as a proxy between a website and the visitor. This system enables users to receive cached static content from the nearest servers. With less physical distance, the site can load faster.
What’s great about Cloudflare is that it has one of the biggest server networks in the world. As such, no matter where your visitors are, Cloudflare will help you deliver the fastest website experience. This will also help improve your site’s SEO as speed is one of the ranking factors in search engines.
Compared to traditional CDN, Cloudflare offers many other useful features:
- DDoS attack mitigation
- Analytics on all requests made to a website
- Easy SSL certificate installation
- Network gateway between protocols
Setting Up Cloudflare on WordPress
Installing CloudFlare on WordPress is a straightforward process. Follow the guide below to learn how to do it.
Step 1: Creating a Cloudflare Account
- Navigate to the Cloudflare website and click the Sign Up button in order to create an account.
- Provide your email and password and then hit Create Account.
Step 2: Adding Domain Name to Cloudflare
- Go to your Cloudflare dashboard. Select the +Add Site button below a notification that reads “You currently don’t have any websites.”
- Now, select your plan. If it’s for a personal site, we recommend choosing the free plan. Otherwise, choose the Pro or Business plan if you intend to use Cloudflare with any business websites.
Step 3: Checking the DNS Records of Your Domain Name in Cloudflare
Once your WordPress site is added to Cloudflare, you’ll be prompted with the DNS details of your domain name. In this step, you can enable or disable Cloudflare for specific subdomains.
To activate, simply toggle the cloud to orange.
We highly suggest that you enable Cloudflare for your naked domain name and www subdomain. This way, Cloudflare will work on both www and non-www versions of your site.
Once you are done, press the Continue button to proceed to the next step.
It’s not recommended to enable CloudFlare for cPanel, mail, FTP, or any other subdomains as it can result in various DNS issues.
Step 4: Pointing Your Domain Name to Cloudflare Nameservers
After activating Cloudflare for your domain and subdomains, you will be greeted with the Cloudflare nameservers on the next page. Now, we need to replace your old nameservers with Cloudflare’s.
- Open a new browser tab and visit your hosting control panel. If you’re a Hostinger user, you can find the details of your nameservers in the Domains tab.
- Replace the existing nameservers with those from Cloudflare. Don’t forget to click Update.
- Go back to the Cloudflare page and press the Done, check nameservers button.
Note that it may take up to 72 hours for DNS to propagate worldwide. Once the nameservers update has been completed, you will receive an email confirmation message from Cloudflare. Alternatively, you can also check the update status on the Cloudflare website. During this process, your page will not face any downtime.
Step 5: Installing and Configuring Cloudflare Plugin on WordPress
To complete the whole process, we need to install the Cloudflare plugin on WordPress. The tool comes loaded with various handy features to manage the CDN, such as:
- One-click WordPress optimization
- Web application firewall (WAF) rulesets
- Automatic cache purge
- Statistics
- Built-in Cloudflare settings for easy modification
Let’s proceed with the plugin installation.
- Access your WordPress dashboard and head over to Plugins -> Add New. Search for Cloudflare, then install and activate the plugin.
- Go to Settings and select Cloudflare.
- Select the get your API Key from here option, located below the log in fields.
- A window that opens your CloudFlare account will pop up. Go to the API Tokens tab, then, select View from the Global API option.
- Enter your Cloudflare password, and then copy the provided API key.
- Go back to the plugin’s settings page, and paste the key to the login fields. Hit the Save API Credentials button.
After you log in to the Cloudflare plugin, you will see several settings:
- Optimize Cloudflare for WordPress — enable it by clicking the “Apply” button. This will implement Cloudflare recommended settings for the best performance.
- Purge Cache — activate this service only after you update your WordPress or website design. This setting will clear all the cached content of your site.
- Automatic Cache Management — automatically clear the Cloudflare cache every time you switch or edit the theme.
Conclusion
A CDN, or Content Delivery Network, is an important service that will help you boost your website speed. Out of the many options available, we recommend Cloudflare. It offers a reliable CDN service, as well as security and performance improvements.
You can set up Cloudflare on WordPress for free. Here’s a summary of how to accomplish that:
- Create your Cloudflare account.
- Add your domain name to Cloudflare.
- Check the DNS records of your domain name in Cloudflare, and then activate the service for your naked and www domains.
- Point your domain name to the Cloudflare nameservers.
- Install the WordPress Cloudflare plugin for easy configuration.
That’s it. Good luck and enjoy your faster website.
Comments
April 03 2020
I am using hostinger.in hosting service. Can I use couldflare for my can. If I change nameservers to cloudflare, will I loose Hostinger.in hosting service?
April 04 2020
Hey, you will not lose Hostinger services, make sure to follow the steps written above and everything will be alright!
April 24 2020
I have followed all above-mentioned steps but I am having an error "Domain status: not pointing to our name servers". I am using hostinger domain & hostinger hosting. Please help
April 24 2020
Hi! I am not able to locate an account with us with your email to see the exact case, but this can occur if you have not added an A record in Cloudflare. A Records are necessary to direct a visitor's browser requests to an origin web server. Access your Cloudflare Dashboard and check if the A record added there is the same as the one in your Hostinger Dashboard. You can see your Hostinger DNS records in your Panel-> Advanced-> DNS zone editor. You will find the A record you need to use there.
May 04 2020
I installed free ssl certificate from cloudflare but it is not working on my website
May 04 2020
Hey, Amit, have you followed all the steps on the tutorial?
July 11 2020
Awesome step by step guidance. thank you so much.
July 14 2020
Happy to help! :)
August 05 2020
I purchased a Cloudflare service on my Hostinger account and I have a problem to set it up. Actually my website doesn't work now and Im trying to resolve the issue. Looks like DNS settings... Please HELP!
November 06 2020
Hey there Salahaddin! Hope you are having a lovely day. Once you set up CloudFlare you may need to tweak few settings based on your DNS configuration, SSL encryption etc. My help is limited via the comments here, but if you message our support team, I am sure they can help you, if your website is hosted here :)
August 07 2020
Hi I am getting an error 1000 message. I have checked and the ftp A record is correct. The nameservers I changed both within the domain and hosting. Site launching on Monday - please help!
November 06 2020
Hey there Natasha! :) Make sure to give it 24 hours before your nameservers propagate correctly. After that make sure not only the ftp A record is correct, but the @ A record needs to point to the same IP address as well! Good luck!
August 09 2020
I done it. But i don't know why sometimes i got error my domain not pointing. Or SSH failed . . . I have to restored default my DNS. Sometime oneday my site went down 5 6 times. Could you have any other advices for me?
November 11 2020
Hey there! I am not sure what steps could a mistake appear on, but please feel free to message our support team, and I am sure they will gladly help you out! :)
August 31 2020
How to use cloudflare protection from hostinger hosting site not from the cloudflare website. I saw this in my hostinger cpanel domain ( Speed up your website and protect it against DDoS attacks for Rs. 545.00 ). Should I buy this for my website? Please help me to activate cloudflare my site.
November 06 2020
Hey there! :) You can just purchase the product and click SETUP :) Then you can chose what website do you want to attach it to and it will be active.
September 15 2020
Hi! It's a informative guide but I have a query that : Which SSL Certificate we have to activate in it (Hosinger SSL or Cloud Flare SSL) ? Or can we use both at a time ?
November 11 2020
Hey Apurb. You can use both. If you do use both - set CloudFlare's encryption to Full instead of Flexible.
September 24 2020
Thanks for the article! I have a question. Is this the same as paying Hostinger SSL ($11.95 ) and Cloudflare ($9.95)? Cheers, Jimmy
November 18 2020
Hey Jimmy. CloudFlare SSL won't replace our Hostinger's SSL, as it can't fully encrypt the connection. If you are using CloudFlare, your domain is connected to CloudFlare, and then the CloudFlare connects to your host (Hostinger). CloudFlare only has the authorization to encrypt the data between the domain and CloudFlare's servers. On the topic of CloudFlare via Hostinger, when you pay the CloudFlare protection via Hostinger, your CloudFlare will be integrated directly in your Hostinger dashboard. This makes it much easier to control, and you won't need to change the DNS at all.
November 27 2020
hey.. I got hostinger cloudflare service in my hosting plan. I did setup on my domain. Should i also have to create cloudflare accout and follow all the above steps to protect my account or not.
February 09 2021
Hi there! If you got Cloudflare from Hostinger side, all you need to do is set up the service from your Home page. You won't need to point your domain to Cloudflare.com and do all the other steps from this tutorial :) If you need any further help with it, our Customer Success team will be happy to help you out via Live Chat.