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.
- Globally Load Balanced CDN
- Caching of Static Content
- DDoS Protection
- Universal SSL Certificate
- Global Anycast DNS
Cloudflare Notes
The following are a few points to note about Cloudflare.
- If Cloudflare goes down, you won’t be able to browse the site
- Updates may not be reflected in the cache
Cloudflare Plan
Cloudflare is available in four plans, depending on price and features.
Free | Pro | Business | Enterprise | |
---|---|---|---|---|
Price | $0/month | $20/month | $200/month | Quote |
CDN | ○ | ○ | ○ | ○ |
Cache | ○ | ○ | ○ | ○ |
Time to live (TTL) | 2h | 1h | 30m | 1s |
Max Upload Size | 100MB | 100MB | 200MB | 500MB+ |
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.

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".

Create a Cloudflare account
Displays a screen for creating a Cloudflare account.
- Enter your email address
- Enter the password
- Click the "Create Account" button

Add a site
Associate your site with Cloudflare.
- Enter the site domain (example.com)
- Click on the "Add Site" button

Select a plan
There are four plans to choose from. In this case, choose the free version.
- Click "Free".
- Click the "Confirm plan" button

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

Updating the name server
Displays your Cloudflare nameservers. Change the existing nameservers at your registrar. Updating your nameservers can take up to 24 hours.
- Switch to the Cloudflare nameservers shown
- Click the "Done, check nameservers" button after changing the name server settings

Start the quick start guide
Click the Get Started button.

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)".
- Click on "Full".
- Click the "Save" button

Selecting the Always Use HTTPS
Set to redirect all requests to http to HTTPS.
- Click to turn it on
- Click the "Save" button

Selecting the Auto Minify
- Check the file format you want to reduce the size of
- Click the "Save" button

Configuring Brotli
Sets whether or not to use Brotli compression.
- Click to turn it on
- Click the "Save" button

Exit Settings
Click the "Finish" button.

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.

Check the API
Get the API key to use the WordPress plugin.
- Click on the icon
- Click on "My Profile"
- Click on "API Tokens"
- Click the "View" button on the right side of the Global API Key. Enter your password to copy the key

Install the plugin
Install the plugin "Cloudflare" in WordPress and activate it.
- Click on Cloudflare from Settings
- Click on "Sign in here"

Enter your email and API keys
- Enter your email address
- Enter the API Key
- Click the "Save API Credentials" button

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.

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

Create a Page Rule
Manage your Cloudflare settings by URL. You can add up to 3 page rules in the free version.
- Click Page Rules
- Click the Create Page Rule button

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*
- Security Level→High
- Cache Level→Bypass
- Disable Apps
- Disable Performance

Don’t cache the preview
Create a page rule to avoid caching the preview as follows.
example.com/*preview=true*
- Cache Level→Bypass

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
- What’s new in WordPress 5.6? New Features and Changes
- How to Add width/height to Images in WordPress
- What’s New in WordPress 5.5.3? Fixed 1 Bug
- WordPress 5.6 jQuery version updates and solution for jQuery
- WordPress Version List (Release Date/Code Name)
- What’s new in WordPress 5.5? New Features and Changes
- What’s New in WordPress 5.5.2? Fixed 10 security issues
- How to check if the current user is Administrator in WordPress
- Vulnerability of File Manager WordPress plugin and Solutions
- Recommend Premium Themes for WordPress (By Usage)
New Articles
- WordPress 5.6 jQuery version updates and solution for jQuery
- What’s New in WordPress 5.5.3? Fixed 1 Bug
- What’s New in WordPress 5.5.2? Fixed 10 security issues
- What’s new in WordPress 5.6? New Features and Changes
- How to use the current_user_can function in WordPress
- How to check if the current user is Administrator in WordPress
- WordPress Template Tags (162 Types)
- How to Setup Cloudflare for WordPress
- Vulnerability of File Manager WordPress plugin and Solutions
- What is the WordPress Template Hierarchy? Priorities by Page Type
- What’s new in WordPress 5.5.1? 44 bugs fixed
- What is a WordPress child theme? Tutorial to create a child theme
- Recommend Premium Themes for WordPress (By Usage)
- Best Free Themes for WordPress (By Usage)
- What is WordPress Theme? Summary of how to choose and use a theme
- What’s new in WordPress 5.5? New Features and Changes
- How to Add width/height to Images in WordPress
- How to Install WordPress
- How to install WordPress locally
- How to Install WordPress Manually