If you have been running a WordPress website and want to make it quick to load whilst also being secure against attacks, then you should consider adding your site to Cloudflare. It is one of the popular tools to help you speed up the website and help you protect from different types of threats towards it. In this guide, I will show you each step so that you are fully aware of how to connect your WordPress site to Cloudflare in the simplest way possible!
It is better to lay out upfront why Cloudflare is very beneficial and how easily it can connect with your WordPress website. At the end of the guide, your website will be good to go for faster performance and more security!
Why Use Cloudflare for Your WordPress Website?
First, let's take a quick spin on what makes Cloudflare one such smart choice for WordPress websites: it just improves sites in three meaningful fronts.
- Cheaper Hosting: Cloudflare has essentially added a front between your hosting servers and people using the internet - the Cloudflare CDN (Content Delivery Network). Every file on your website will be stored on the server that is closest to your users, thus making it absolutely accessible when required.
- Loads of Protection: Cloudflare shields your site from numerous online attacks ranging from Simple DDoS (Distributed Denial of Service) attacks to potshots taken by bots aimed at cracking your site.
- SEO Ranking: Google and other search engines such as Bing really like websites that load fast and are also secure - if you use Cloudflare, chances are you will see your ranks improve on the search engine result pages.
With Cloudflare, you can rest assured without worrying about speed and security - you get both, and it's entirely straightforward to set up!
What You Should First Know
Now before we sneak into start working, prepare these things in advance:
- You must have a live WordPress website.
- A Cloudflare account (you can create one through cloudflare.com).
- You must have access to the DNS settings of your domain (that you can get through your website host).
Now that you have these, you're set to go with Cloudflare setup on your website!
Step 1: Create Account on Cloudflare
- When you get a visit to the Cloudflare website, if you do not have any account, then click on Sign Up; if you already have an account, click Log In and provide the email address and password to log into.
- Enter the necessary details to create your account and click Create Account.
Tip: Use a strong password to keep your Cloudflare account secured.
Step 2: Add Your Website to Cloudflare
- Once logged in, click on the button to add a site in Cloudflare's dashboard.
- In the box, type in your WordPress website's domain name (for example, www.yoursite.com) and click Add Site.
- Choose a plan. Cloudflare has a Free plan which provides enough security and speed improvement which will meet requirements of most websites, especially smaller and medium ones.
Once you choose, click Continue to proceed to the next step.
Step 3: Scanning Your DNS Records
Cloudflare might take around a few minutes to scan and pull your DNS records. These records are a set of instructions that inform the Internet where your website and its services, such as email, are located.
Confirm the DNS Records
- Go through the displayed DNS records to ensure that the DNS records by your Website host are there: A, CNAME, and MX would be present.
- If any record is missing, you can add it by clicking Add Record.
Tip: Make sure that the orange cloud icon is turned on next to every record you want Cloudflare to speed up and protect. If there is a gray tick mark beside it, that means Cloudflare is not going to affect that record.
Click on the Continue button to proceed further.
Step 4: Change Your Domain Name Servers
You need to change the domain name servers in order to connect Cloudflare to your site. These name servers basically act like signposts guiding traffic on the internet.
To change nameservers:
- Log into your domain registrar from which you purchased your domain. Such could be GoDaddy, Namecheap, or Bluehost.
- Find the DNS or Nameservers settings depending on your registrar.
- Replace the present nameservers with the ones Cloudflare provided.
For example:
- Nameserver 1: gabe.ns.cloudflare.com
- Nameserver 2: melissa.ns.cloudflare.com.
Step 5: Set Up Basic Cloudflare Settings
Cloudflare has a host of settings to improve your speed and security; a couple important ones are as follows.
Enable SSL/TLS for Secure Connections
SSL/TLS settings are used to make sure that all connections to your website are secure.
- In your Cloudflare dashboard, go to SSL/TLS > Overview.
- Select SSL mode best for your site:
- If your website already has SSL through your hosting provider, choose Full or Full (strict).
- If not, select Flexible.
Tip: SSL settings help keep your site secure, which can help your SEO ranking as well.
Set Caching for a Faster Load Time
The caching services keep copies of your website's content, enabling it to load faster.
- In the Caching tab, choose Standard as the Caching Level.
- Select Always Online; this allows Cloudflare to show a saved version of your site should your server go down.
- If you've made large changes to your website, go Purge Cache > Purge Everything to refresh the cached content.
Set Up Page Rules for Special Control
Page rules control all settings of several means of controls you can use at different URLs within your domain with Cloudflare Page Rules.
- In the Page Rules section, click Create Page Rule.
- Set up your Page Rule by enteringwww.yoursite.com/*, and choosing the settings for your Page Rule, such as Cache Everything, Always Use HTTPS, or such.
Page Rules give a wide range of possibilities for tweaking the decisions on caching, security, and performance for certain areas on your website.
Step 6: Installing the Cloudflare Plugin Using WordPress
To gain even more control, you can install the official Cloudflare plugin.
- Navigate to Plugins > Add New in your WordPress Dashboard.
- Search for Cloudflare and install it, then activate it.
- Open Settings > Cloudflare in WordPress.
- Enter your Cloudflare email and API key (found by going to your Cloudflare account under My Profile > API Tokens).
- Change some settings of the plugin such as Automatic Cache Purge, which clears cache when you update your content.
The Cloudflare plugin allows you to manage certain Cloudflare features directly from WordPress.
Step 7. Test Your Website for the Results
Now that your WordPress site has been connected to Cloudflare, let's ensure that everything is running smoothly as they should:
- Test your site's load time with tools like GTmetrix, Pingdom, etc., which should give faster ensuing speed.
- Check that your SSL certificate is up and running and that you can access your site via HTTPS.
- Open your website in incognito or private browsing to see how the site appears with Cloudflare settings.
Tip: Use the Analytics tab on Cloudflare to check the volume of traffic that Cloudflare is handling and how much faster your website has become and secure.
Use these additional tips to get the most out of Cloudflare.
Brotli Compression
Brotli compression reduces the number of bytes, which helps in speeding up loading for users.
- Open the Cloudflare website,then click on Speed > Optimization.
- Enable Brotli.
Image Optimization using Polish (Paid Feature)
If you are a paid user of Cloudflare, every time you upload an image, Polish will optimize it for size, and this will bring down loading times for your users. Polish is especially effective if your website features images prominently.
Activate Web Application Firewall (WAF)
Enable Cloudflare's WAF for enhanced security. WAF is an additional service included in paid plans meant to help stop malicious traffic and threats from penetrating your site.
The End-Now Enjoy a Quicker, Safer WordPress Site
Well, that's it! You have successfully connected your WordPress site with Cloudflare. By leveraging this guide, you are all set to create a faster-loading, more secure, and happier experience for your visitors.
