How To Set Up Cloudflare for WordPress?
Content Delivery Network ( CDN) is one of the best ways to reduce page loading time. There are numerous methods to choose from, but Cloudflare stands out best among the rest because of its exceptional service. What’s great, you can use it for free! Keep scrolling down to learn how to set up Cloudflare for WordPress!
What is CloudFlare?
Cloudflare is an American web-infrastructure and website-security service, providing content-delivery-network services, DDoS mitigation, Internet security, and distributed domain-name-server services.
Cloudflare accelerates your websites and protects your website from malicious visitors and bots.
It improves the page load times by caching your website content to all of their globally distributed network of servers.
Cloudflare is a free & paid service that accelerates and secures your website by acting as a proxy between your visitors and servers.
How Does It Work?
After Cloudflare is enabled for your site, it is designated as your authoritative name servers; this allows CloudFlare to clean and accelerate your traffic as all requests to your website are now routed through Cloudflare.
With network routing technology and 23 data centres around the world, Cloudflare can:
- Bring visitors the fastest connection possible –
- Screen your website’s traffic for malicious visitors –
- Cache static content on your site –
- Optimize your web content –
Advantages of Cloudflare
There are several advantages to using the Cloudflare service:
- Site Performance Improvement –
- Mobile Device Optimization –
- Bot and Threat Protection –
- Spam Comments Protection –
- Alerting Visitors of Infected Computers-
- Offline Browsing Mode –
- Lower Resource Usage –
- New Site Stats –
- CloudFlare Apps –
- SSL Support –
Limitations of CloudFlare
Before enabling Cloudflare for your website, you may want to consider the following:
- Currently, requests must be directed to www.yourdomain.tld instead of ofyourdomain.tld, which means you may need to make some configuration changes (WordPress installations are automatically adjusted).
- Cloudflare caches static content from your site. While this reduces the load on your server, it means that if you make a change to an existing static file, like an image, there may be a delay before the change appears. While you are updating your site, you can put CloudFlare in Development Mode so that changes occur immediately.
How To Set Up Cloudflare for WordPress!
Currently, Shared and Linux plans may enable and manage CloudFlare services directly via cPanel.
Set Up Cloudflare For WordPress
Installing CloudFlare is a straightforward process. Follow the guide below to know how to do next:
Step 1: Creating a Cloudflare Account
- Navigate to the Cloudflare website and click the Sign-Up button to create an account.
- Provide your email and set a password to create an account.
Step 2: Adding Site To Cloudflare
Follow simple instructions to add your website or application. No code changes required.
Step 3: Select Plan
Select the plan that provides the security and performance you need.
Now, select your plan. If it’s for a personal site, I recommend you to choose the free plan. Otherwise, choose the Pro or Business plan as your business websites requirement.
Step 4: Checking the DNS Records of Your Domain Name in Cloudflare
Once your 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/Set Up Cloudflare For WordPress, simply toggle the cloud to orange.
I 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.
Step 5: Replace with Cloudflare’s nameservers
After activating Cloudflare for your domain and subdomains, you will be greeted with Cloudflare nameservers on the next page. Now, we need to replace your old nameservers with Cloudflare’s nameservers.
- Open a new browser tab and visit your domain control panel. You can find the detail of your nameservers in the Domains tab.
- Replace the existing nameservers with those from Cloudflare. Don’t forget to click Update/Save.
- Go back to the Cloudflare page and press the Done, check nameservers button.
Step 6: Select Flexible(Free SSL)
Step 7: Enable Always Use HTTPS
Step 8: Auto Minify
Note: 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 status on Cloudflare website. During this process, your page will not face any downtime.
Read More : How To Host WordPress Website on DigitalOcean
Step 9: Installing and Configuring Cloudflare Plugin
To complete the whole process, we need to install the Cloudflare plugin on WordPress. The tool comes with various handy features to manage the CDN, such as:
- One-click WordPress optimization
- Web application firewall (WAF) rulesets
- Automatic cache purge
- 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
Automatic Cache Management
CDN, or Content Delivery Network, is an important service that will help you boost your website speed. Out of so many options, I recommend you to use Cloudflare. It offers a reliable CDN service, as well as security and performance improvements.
What’s cool, you can set up Cloudflare on WordPress for free, as I have explained above. To summarize, here’s how you do that:
Set Up Cloudflare For WordPress
- 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 Cloudflare nameservers.
- Install WordPress Cloudflare plugin for easy configuration.
How To Set Up Cloudflare for WordPress