How to Configure Cloudflare for WordPress

how to configure cloudflare for wordpress

There are billions of websites live right now and each one is fighting for survival.

If you’re building a website, you’d want the best features for it. After all, this makes the visitor experience more streamlined and convenient. But without a lot of experience in website development, you’d feel lost on where to start.

It’s not the end of the world yet. We’re here to help!

In this guide, you’ll learn how Cloudflare for WordPress works for you. Read on and learn some invaluable WordPress tips to make your website better today:

What is Cloudflare?

This is a service that aids to increase your website’s performance and speed. Its features include CDN, Free DNS, and DDoS attack protection. It has the means of caching your website’s static content and delivers it more rapidly.

It downloads your website’s static pages to its server, enabling them to display it to your visitors faster. Cloudflare’s CDN does this by using its 152 data centers across the globe. So, when users send a request to your website, Cloudflare delivers the content using the closest server to their geographical location.

With this, the loading time for your website dramatically decreases. This means your website’s loading speed is faster. This is an important step in reaching the top of Google’s search engine results page since the search engine’s algorithm considers loading speed a factor in determining your site rank.

Cloudflare both has free and premium versions. The former is a good starting point if you have a small website for personal content. But if you plan to expand and deliver more content in the future, upgrading to the premium version is your best bet.

Benefits of Cloudflare

If you wish your website to remain competitive and rise to the top, you might want to look into Cloudflare.

Here are the benefits of using Cloudflare for your WordPress website:

1. Free SSL

If your website has sensitive information, you must have an SSL certificate. It matters not what website you have since SSL isn’t exclusive for eCommerce. If your site is accessible over HTTPS, your data has encryption from your visitors’ computers to your server.

Also, SSL is another factor Google uses whether your website ranks higher on the search engine results page. With Cloudflare, you get a free universal SSL certificate along with its other features.

2. DNS Security

Cloudflare allows you to add DNS security to your domain. You can do this by enabling the Domain Name System Security Extension (DNSSEC). This feature decreases your vulnerability for request forgery.

If you have little technical expertise, worry not. It’s easy to enable this feature since all you need is to go to the DNS tab and press the blue Enable DNSSEC button.

3. Image Optimization

Does your website come with lots of images? If so, Cloudflare has the Polish feature that aids in optimizing their file size to speed up their loading times. You have the option to pick between lossless and lossy compression.

Polish also supports WebP compression, but it’s only available if you have a PRO plan and above. Regardless, this is a great feature for eCommerce websites with lots of images for their products.

4. Browser Caching

This feature instructs your visitors’ browsers to cache your website’s static resources for a longer duration. This means repeat requests for your websites get loaded from their local cache. This will further expedite your web page loading.

You need not bother using third-party plugins or leveraging browser caching using .htaccess. Instead, go to Cloudflare and accomplish the same thing under the Caching tab.

5. Load Balancing

This feature is more recent, but it’s invaluable in making your website perform better. The cloud load balancer distributes your web traffic to various servers. With this, your website will always be available even when one server goes offline.

With a load balancer, you also get WordPress automatic failover support, geographic routing, and health checks. All these will contribute to your website’s availability and speed.

How to Install Cloudflare for WordPress

With all these benefits, you have more reasons to get Cloudflare for your WordPress website. Below are the necessary steps for configuring Cloudflare. Don’t hesitate to learn how to make effective landing pages using WordPress.

1. Make a Cloudflare Account and Add Your Website

To start, go to the Cloudflare website and make a new account. After you finish the simple sign-up process, Cloudflare will take you to their interface. This is where you’ll add your website by adding your domain name in the input box and clicking the Add Site button.

Cloudflare automatically queries your DNS records. If you aren’t technologically inclined, Cloudflare gives a short and simple explanation on the following screen. If you’re satisfied with it, click the Next button to proceed.

After pressing the button, the website will upsell its premium packages. Whether you go with the free plan or a paid one, click Confirm Plan to go to the next step.

2. Verify Your DNS Records

After confirming your preferred plan, Cloudflare will ask whether your DNS records are correct. If you aren’t developing a website, worry not. As long as you see an orange icon next to your website’s address, it means your DNS records are accurate.

After verifying that everything is as it should be, click the Continue button at the bottom of the page.

3. Change Your Nameservers to Point to Cloudflare

This step is more technical, but at its simplest, you must change your domain’s nameservers to point to Cloudflare’s nameservers. This ensures that Cloudflare manages everything at a DNS level for you. You must do this where you registered your website’s domain name.

If you’re unsure how to do this, Cloudflare’s interface has a link called “I need help changing my nameservers.” Click on it or ask your host to assist you with the process.

After changing your nameservers, click Continue to proceed. Take note, it could take a while before your new name servers get updated. During this time, you’ll see a DNS modification notice.

The good news is your website won’t experience any downtime even when Cloudflare hasn’t updated your interface. After your change goes through, your interface will show that your website status is active.

This means your basic Cloudflare configuration process is successful. But it doesn’t mean that you’re done configuring it specifically for WordPress.

Configure Cloudflare Settings for WordPress

Cloudflare has a WordPress plugin to assist in setting it up for WordPress. If you’re using plugins like WP Rocket or W3 Total Cache for caching, those have Cloudflare integrations too. That means with these plugins, you can do the same process.

1. Install and Activate the Cloudflare Plugin for WordPress

You can make these changes using Cloudflare’s dashboard. But with the plugin, you simplify the process even more. It also allows you to manage your Cloudflare settings using the WordPress dashboard. This is convenient if you want to manage everything in one place.

Like any plugin listed on the WordPress website, you can install Cloudflare using your dashboard. After activating it, go to your Settings and look for Cloudflare. Click on the ensuing link to sign in to your Cloudflare account.

Aside from your email address, you must enter your API Key. This is easy to find since all you need to do is to go to your profile page. Look for the API Key section, where you’ll find View API Key next to the Global API Key fields.

Copy the values after viewing it and paste it into your plugin’s interface. After that, click on the button that says Save API Credentials. After saving them, this unlocks the Cloudflare plugin interface.

Here, you’ll see the options to Optimize Cloudflare for WordPress. Click on the Apply button next to it to tweak its settings for WordPress.

2. Configure WordPress-specific Page Rules

After setting up the Cloudflare plugin, your next step is to configure some page rules. This will change the way Cloudflare works with your website. Page rules enable Cloudflare to do specific actions for certain website components.

As a general rule, you want Cloudflare to add an extra security layer to your login page. Also, you must put your wp-admin area as an exception to Cloudflare caching to avoid future issues. Also, if you’re using HTTPS, you can instruct Cloudflare to force HTTPS too.

Go to your Cloudflare dashboard and go to the Page Rules tab. Click on the Create Page Rule option and change your Security Level to High. For your wp-admin page, set your Cach Level to Bypass and Disable both Performance and Apps.

WordPress Works Best on Pressable!

Do you need a good WordPress host? If so, contact us today. We can help you improve your website performance with our WordPress-specific hosting services.

Zach Wiesman

Zach has 12+ years of experience with WordPress, from creating and maintaining client sites, to providing support and developing documentation. A knack for problem-solving and providing solutions led Zach to pursue a job with Automattic providing customer support in 2015 working with WooCommerce support, and now Zach has recently joined our team here at Pressable. Outside of work, Zach enjoys spending time with his family, playing and watching sports, and working on projects around the house.

Related blog articles