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
The best Cloudflare Page Rules for WordPress can be found in the following article.
Best Cloudflare Page Rules for WordPress
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).