If you have recently added a custom domain to your WordPress.com site and want to harness the power of Cloudflare CDN, you have come to the right place. In this article, I’ll show you how you can add your WordPress.com site to Cloudflare for free.
What is Cloudflare
Cloudflare is a content delivery network that also provides Internet security services and distributed domain name servers acting as a reverse proxy for websites. Cloudflare protects, speeds up, and improves the reliability of a website or mobile application.
Why you should use Cloudflare with WordPress.com
The main reason why you must use Cloudflare with WordPress.com is that it allows you to compress and cache your web pages which are otherwise not possible. Also, it can help the pages load in a faster manner for end-users by loading the scripts first that are actually required and pushes the other requests down.
Moreover, it can allow you to use Google Analytics on your WordPress.com site for free. Without Cloudflare, you’d need to be on their Business or eCommerce plan to do that. Also, Cloudflare gives us options to obfuscate email addresses, hide specific content from suspicious visitors, protect your images from off-site linking, and more,
Here’s the GTmetrix performance report for this site when it was hosted on the WordPress.com Personal plan along with Cloudflare –
Here’s the full GTmetrix performance report for my blog – Download/View the PDF.
Steps to add WordPress.com site to Cloudflare
Step 1 – If you haven’t got an account yet, get one from Cloudflare.com.
Step 2 – Login to your Cloudflare Dashboard.
Step 3 – If you’re new to Cloudflare, click here to enter setup and enter the domain name you want to add to Cloudflare, and hit ‘Scan DNS Records‘. It will take around a minute or two to finish scanning the records. Once the scan is complete, hit ‘Continue Setup‘ to proceed to the next step.
Step 4 – In the next step, you need to delete the A records. The scanning process from Cloudflare picks up multiple A records for your domain and displays it along with the other records. This step is very important because your website won’t have a static IP address on WordPress.com’s cloud infrastructure. It will keep changing as they shift data centers.
***Make sure you do NOT delete the other records, such as mail, MX, TXT, etc***
The A records look like 👉 A yourdomainname.com IP address
Step 5 – In this step, add a CNAME record 👉 yourdomainname.com is an alias of lb.wordpress.com
It should look something like this –
Don’t forget to replace my domain name with yours!
NOTE: Make sure all the clouds are orange. If not, click on the grey cloud to make it orange. Now all the traffic will go through Cloudflare.
Step 6 – Now finish the setup, that is, follow the onscreen instructions to complete the configuration.
Step 7 – Now, you will need to change your name servers to Cloudflare’s instead of your domain registrar’s. If you registered your domain through WordPress, use this link to go to the domain configuration page. You will need to turn off the option ‘Use WordPress.com Name Servers‘. Then enter the name servers Cloudflare provided you with. Don’t forget to save the custom name servers.
NOTE: If you had registered your domain name through any other registrar than WordPress, then you will need to change your name servers from there. Here’s an easy tutorial by Cloudflare on how to do that.
That’s it. We have finished configuring the WordPress.com custom mapped domain with Cloudflare.
Don’t forget to log in to your Cloudflare dashboard and recheck the name servers to make your domain active on Cloudflare. You can follow the steps given over here to perform the same.
Once your website is active on Cloudflare, you can :
- Adjust your website’s Security Level
- Set Caching Levels
- Set Browser Cache Expiration
- Turn on Always Online™
- Auto Minify Static Assets
- Turn on Rocket Loader™
- Enable Automatic HTTPS Rewrites, etc.,
Feel free to play with Cloudflare’s settings. If you’re unsure of any option just perform a quick search and you will get the answers. Or, you could just leave a comment below!
I hope you found this guide to adding a WordPress.com site to Cloudflare useful.
Also Read: Redirect non-www URLs to www using Cloudflare.