How to Setup Cloudflare for WordPress

Last Updated:

This article explains how to set up Cloudflare for WordPress, which allows you to connect Cloudflare to WordPress to use features like CDN, DNS, and DDoS protection. It explains in detail step by step.

What is Cloudflare?

Cloudflare is a reverse proxy service that provides CDN (Content Delivery Network), DNS and DDoS protection.

Cloudflare Features

The following are some of the features of Cloudflare.

Cloudflare Notes

The following are a few points to note about Cloudflare.

Cloudflare Plan

Cloudflare is available in four plans, depending on price and features.

FreeProBusinessEnterprise
Price$0/month$20/month$200/monthQuote
CDN
Cache
Time to live (TTL)2h1h30m1s
Max Upload Size100MB100MB200MB500MB+
DDoS Protection
Email Support
Chat Support××
Phone/Emergency Support×××

WordPress Plugins

Cloudflare offers a dedicated WordPress plugin. Activating the plugin allows you to manage your Cloudflare settings from your WordPress dashboard.

WordPress Plugins

How to set up Cloudflare for WordPress

To set up Cloudflare on WordPress, do the following steps.

Access Cloudflare

Go to the official Cloudflare website (https://www.cloudflare.com/) and click on "Sign Up".

Access Cloudflare

Create a Cloudflare account

Displays a screen for creating a Cloudflare account.

  1. Enter your email address
  2. Enter the password
  3. Click the "Create Account" button
Create a Cloudflare account

Add a site

Associate your site with Cloudflare.

  1. Enter the site domain (example.com)
  2. Click on the "Add Site" button
Add a site

Select a plan

There are four plans to choose from. In this case, choose the free version.

  1. Click "Free".
  2. Click the "Confirm plan" button
Select a plan

Checking DNS Records

The current DNS record will be displayed. Check the content and click the "Continue" button.

Checking DNS Records

Updating the name server

Displays your Cloudflare nameservers. Change the existing nameservers at your registrar. Updating your nameservers can take up to 24 hours.

  1. Switch to the Cloudflare nameservers shown
  2. Click the "Done, check nameservers" button after changing the name server settings
Updating the name server

Start the quick start guide

Click the Get Started button.

Start the quick start guide

Selecting the SSL/TLS option

Select the SSL / TLS option. If you have already set up SSl on the server, select "Full" or "Full (Strict)".

  1. Click on "Full".
  2. Click the "Save" button
Selecting the SSL/TLS option

Selecting the Always Use HTTPS

Set to redirect all requests to http to HTTPS.

  1. Click to turn it on
  2. Click the "Save" button
Always use HTTPS or configure it

Selecting the Auto Minify

  1. Check the file format you want to reduce the size of
  2. Click the "Save" button
Selecting Files to Reduce

Configuring Brotli

Sets whether or not to use Brotli compression.

  1. Click to turn it on
  2. Click the "Save" button
Configuring Brotli

Exit Settings

Click the "Finish" button.

Exit Settings

Make sure the connection is complete.

Make sure the name server update reflects the name server update and that the connection to Cloudflare is complete.

Make sure the connection is complete.

Check the API

Get the API key to use the WordPress plugin.

  1. Click on the icon
  2. Click on "My Profile"
  3. Click on "API Tokens"
  4. Click the "View" button on the right side of the Global API Key. Enter your password to copy the key
Check the API

Install the plugin

Install the plugin "Cloudflare" in WordPress and activate it.

  1. Click on Cloudflare from Settings
  2. Click on "Sign in here"
Install the plugin

Enter your email and API keys

  1. Enter your email address
  2. Enter the API Key
  3. Click the "Save API Credentials" button
Enter your email and API keys

Optimizing Cloudflare for WordPress

Click the "Apply" button. Your settings will be optimized automatically. That is all you have to do to set up Cloudflare for WordPress.

Optimizing Cloudflare for WordPress

Clearing the Cloudflare cache

To clear the Cloudflare cache, click the Puge Cache button in the WordPress plugin Cloudflare.

Puge Cache

Create a Page Rule

Manage your Cloudflare settings by URL. You can add up to 3 page rules in the free version.

  1. Click Page Rules
  2. Click the Create Page Rule button
Create Page Rule

Protect WordPress Administration and don’t cache it

Create the following page rules to protect your wp-admin distribution and not to cache it.

example.com/wp-admin*
Page Rule

Don’t cache the preview

Create a page rule to avoid caching the preview as follows.

example.com/*preview=true*
Page Rule

In the case of Redirect Loop

If you have SSL configured on the server side, selecting Flexible raises ERR_TOO_MANY_REDIRECTS.

Select Full or Full (strict).

Most Popular Articles

  1. What’s new in WordPress 5.5? New Features and Changes
  2. How to Add width/height to Images in WordPress
  3. WordPress Version List (Release Date/Code Name)
  4. What is WordPress’ server requirement? Support for Each Version
  5. What is a WordPress child theme? Tutorial to create a child theme

New Articles

go to top