If you have recently mapped a custom domain to your WordPress.com blog or website and want to harness the power of Cloudflare, you have come to the right place.
Note: If you are looking for ‘how to add your self-hosted WordPress blog to Cloudflare’, read this Cloudflare tutorial instead.
What Is Cloudflare CDN
Cloudflare is a content delivery network which 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 – Cloudflare allows you to cache, minify, protect, speed up, use Google Analytics, etc., with your WordPress.com site, which is impossible to do in WordPress.com as they require enterprise-level plans for that level of customization. Also, Cloudflare gives us options to obfuscate email addresses, hide specific content from suspicious visitors, protect your images from off-site linking, etc.,
Here’s the GTmetrix performance report for this blog :
Here’s the full GTmetrix performance report for my blog – Download/View the PDF.
Steps To Get Started
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 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!
Also Read: Redirect non-www URLs to www using Cloudflare.