Cloudflare is the most popular content delivery network (CDN) for WordPress sites. The popularity comes due to the fact that many hosting companies offer the basic Cloudflare plan for free. If you are launching your WordPress blog then we recommend you to setup Cloudflare from the beginning to make use of the features. In this article, we will explain how to add WordPress site in Cloudflare account.
Table of Contents
There are many CDN services available for WordPress site. However, basic Cloudflare plan is the best option for beginners.
- Easy CDN setup without creating special CNAME records
- Global delivery with connected servers on 100+ countries
- Free SSL certificate to serve your content through HTTPS
- Basic protection from bad robots
- Speedup your website by compressing and minifying files
- Free plan also allows 3 page rules to customize the caching
- Get detailed analytics of your traffic
How to Setup Cloudflare?
In addition, it will be easy to manage the setup at Cloudflare without logging into your hosting account.
Cloudflare Account Setup
The first step in manual setup is to create your free Cloudflare account. Go to Cloudflare website and signup for the free basic plan. After signup, login to account using your email and password.
You will see a list of websites previously added under “Home” section. Click on “Add a Site” button to setup Cloudflare for your WordPress.
Enter your domain name in the next screen and click on “Add site” button.
You will see all available pricing plans, scroll down and choose the free plan to continue further.
Cloudflare will start scanning your site and fetch the current DNS records.
All available DNS records on your site will be automatically imported and you can add any missing record manually. Make sure to check all entries are proxied and showing orange cloud icon. If you really do not want any subdomains or subdirectories to exclude from Cloudflare, you can simply click on the proxy status or delete the record.
After verifying your DNS entries, click on “Continue” to move on to next step. This is a final step to change the nameservers of your domain with Cloudflare’s nameservers.
You will see the details of your current domain registrar, nameservers and Cloudflare’s servers.
Change DNS of Your Domain
first copy the Cloudflare nameservers and login to your domain registrar account. In this example, we will explain with GoDaddy which may change depending on from who you have purchased your domain. Edit DNS records of your domain and choose to use your own nameservers. Provide the copied Cloudflare servers and save your changes.
In most cases you will see a warning message like below that changing nameservers is risky and you have to provide your consent.
Confirm the changes and make sure your nameservers are changed to Cloudflare’s servers.
Finishing Setup in Cloudflare
Now, head back to Cloudflare and check your nameservers.
Generally, the changes will take some time to take effective depending on the site’s traffic. For a new site, DNS changes will be faster and you can check the setup with by clicking on “Check nameservers” button.
You can submit the check once per hour, though Cloudflare will also scan your site periodically and detect the nameservers.
If everything goes fine, you will see a success message that your WordPress site is successfully added in Cloudflare. You will also receive an email with the details indicating the Cloudflare setup with your WordPress site completed.
Customizing Cloudflare Options
After adding your site successfully, Cloudflare will take you through 3 steps quick wizard. You can setup important things using the wizard and change the setup later anytime from the dashboard. We recommend you to go through the quick start guide to complete the initial setup by clicking on “Get Started” button.
Under improve security section, you can enable automatic HTTPS rewrites to fix mixed content warning in browsers. This will help you to always serve site’s content with secured HTTPS protocol.
We also recommend to enable Brotli compression to speed up the page loading time.
Finally, you will see the summary of your selections and click “Finish” button to complete the quick setup.
Test Your Site
After completing the setup, you should check the site on the browser to make sure everything is working as expected. You can navigate through various sections in Cloudflare account to use other free options and get detailed analytics. For example, you can go to “Speed” section and test how much is the improvement in page loading speed after setup Cloudflare with your WordPress site. As you can see in the below screenshot, it shows 36% faster after setting up Cloudflare.
Removing Cloudflare Setup
Many people do not like to change the DNS nameservers as it will send all traffic through Cloudflare’ servers. However, this has plenty of advantages like completely protecting your site with firewall when you want to upgrade your plan. The other advantage is you can disable Cloudflare anytime by simply changing the DNS on your domain registrar account. After that you can remove the site from Cloudflare to serve pages from your hosting server or from other CDN services.
There is no need to change CNAME records with free account setup. Similarly, you also no need to worry about setting up 301 redirects for you media files which is necessary when you have CNAME zones with provides like StackPath.
Caching Plugins and Cloudflare
Most of the users install caching plugins to speed up their site. However, there are some options overlap with caching and Cloudflare CDN setup. As mentioned above, make sure to enable minification only in one place to avoid breaking your site’s layout. In addition, plugins like W3 Total Cache and WP Rocket offers extension/ add-on for Cloudflare. You can enable the add-on and connect your Cloudflare account. This will allow the plugin to fetch already configured details from your Cloudflare account and optimize properly.