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.
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.
Provide the information required, and then click on the ‘Create account now’ button. In the next step, enter your website’s url.
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.
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.
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 ftp.yourdomain.com for FTP, and ssh.yourdomain.com 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.
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.
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.
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.