Cloudflare is a company that provides Content Delivery Network (CDN), DNS, DDoS protection, and security services. They are renowned in the web performance industry for their fast DNS lookup times and maintain a robust network of over 100 data centers worldwide. Backed by industry leaders such as Google, Microsoft, and Qualcomm, their clients include NASDAQ, Digital Ocean, Zendesk, and Cisco.
If you’re looking for a simple way to speed up and enhance the security of your WordPress website, Cloudflare is an excellent solution. Most users can even get started with their free plan, which offers unlimited CDN bandwidth. Follow the steps below to install Cloudflare on your WordPress website.
Note: If you use Cloudflare, you cannot use premium DNS from Amazon Route 53. Cloudflare operates as a full proxy service, meaning you must choose one or the other. If you want to use advanced DNS, you can opt for an alternative CDN to accelerate your website, such as KeyCDN, which is not a full proxy.
Installing Cloudflare
This tutorial assumes you already have a Cloudflare account. If you don’t, you can visit the Cloudflare website and sign up for a free account.
Step 1: Add and Scan Your Site
Log in to your Cloudflare dashboard.
Click “+ Add Site”.
Enter your WordPress site’s domain name (e.g.,
yourdomain.com) and click “Begin Scan”. No need to addwwworhttp://—the root domain is sufficient.
Add WordPress Site to CloudflareThe scan may take a minute or two. Once complete, click “Continue Setup”.
Step 2: Configure Your DNS Records
Cloudflare provides two options: use their CDN and protection (to accelerate and secure your website) or simply use their DNS. Most users will prefer the former, as this is where you’ll benefit from all of Cloudflare’s features.
To ensure your domain is proxied through Cloudflare, make sure the corresponding “cloud” icon is orange (ON).
For other records that should not be proxied, such as email (MX records), ensure the “cloud” icon is gray (OFF).

Verify DNS Records
After verifying all records are configured correctly, click “Continue”. You can modify these records at any time later.
Step 3: Select Your Cloudflare Plan
On the next page, select a Cloudflare plan. We recommend starting with the Free plan for most users. Then click “Continue”.

Free Cloudflare Plan
You can read more about the differences between Cloudflare plans here.
Step 4: Change Your Nameservers
Next, you need to change the nameservers at your domain registrar to those provided by Cloudflare. Because Cloudflare is a full proxy service, it works by pointing visitor requests to Cloudflare’s network first, which then forwards them to your server address.
There is typically no downtime when switching nameservers.

Change to Cloudflare Nameservers
After making the change at your registrar, return to the Cloudflare dashboard and click “Continue”.
This change can take up to 24 hours to fully propagate.
Step 5: Update Your A Record
If Cloudflare’s scan did not correctly identify your server IP, you need to manually update the A record.
In your Cloudflare dashboard, click the “DNS” tab.
Next to the A record for your domain (usually
@oryourdomain.com), ensure it points to the correct IPv4 address of your server.
Update Cloudflare A Name Record
That’s it! Your WordPress website now has Cloudflare installed and active.
Step 6 (Highly Recommended): Install the Official Cloudflare WordPress Plugin
For WordPress users, we highly recommend this additional step. While not mandatory, some Cloudflare features may not function properly if you don’t install the official Cloudflare plugin.
You can download it from the WordPress Plugin Repository or search for it under “Plugins” > “Add New” in your WordPress dashboard. The plugin features:
Fixes WordPress comments from the same IP address.
Automatic cache purge: Automatically clears Cloudflare’s cache when you update content in WordPress.
Prevents redirect loops: Rewrites HTTP headers to prevent redirect loops when Cloudflare’s Universal SSL is enabled.
Dashboard control: Change Cloudflare account settings (like purging cache, adjusting security level, configuring image optimization, etc.) directly from the plugin.
View analytics: See data such as total visitors, bandwidth saved, and threats blocked.
Support for HTTP/2/Server Push.
Configuring the Plugin:
After installing and activating the plugin, go to “Settings” > “Cloudflare” in WordPress.
You need to enter your Cloudflare account email address and API Key.
You can get your API Key here. Copy the one labeled “Global API Key”.
After entering the information, click “Save API Credentials”.

Cloudflare WordPress Plugin API CredentialsUnder the “Home” tab, you can apply default settings or customize them as needed.

Cloudflare Plugin Default SettingsUnder the “Settings” tab, you can enable image optimization (available on Pro plans), turn on development mode, change the security level, and enable Automatic HTTPS Rewrite.

Cloudflare Plugin Speed and Security SettingsUnder the “Analytics” tab, you can view the number of requests, bandwidth, visitors, and threats on your WordPress site.

Cloudflare Plugin Analytics
Common Cloudflare Issues
Solving the “ERR_TOO_MANY_REDIRECTS” Error
A very common error users encounter when trying to install Cloudflare on their WordPress website is “ERR_TOO_MANY_REDIRECTS” in Chrome or “The page isn’t redirecting properly” in Firefox.
This usually happens because SSL (HTTPS) is already configured on your web server, and you have enabled “Flexible” SSL mode in Cloudflare.
Solution: In your Cloudflare dashboard, go to “SSL/TLS” > “Overview”.
Change the encryption mode from “Flexible” to “Full” or “Full (strict)”.

Set Cloudflare encryption level to Full
Alternatively, you can create a Page Rule to resolve this issue.
How to Clear Cloudflare Cache
Encountering issues with outdated content? Sometimes you need to clear (purge) the Cloudflare cache. There are two simple ways:
Option 1 – Clear via the WordPress Plugin
If you have the Cloudflare WordPress plugin installed, you can easily clear the cache from your WordPress dashboard.
Go to “Settings” > “Cloudflare”.
Find the cache purge option in the plugin interface (usually under the “Home” tab) and click “Purge Cache” or a similar button.
Option 2 – Clear via the Cloudflare Dashboard
You can also purge all cache directly from the Cloudflare dashboard.
In the Cloudflare dashboard, click the “Caching” tab.
Click “Configuration”.
Click the “Purge Everything” button.
Note: Purging everything may temporarily affect site performance as all assets need to be fetched from the origin server and re-cached. Therefore, it’s best to purge only specific files when possible.
Purge a Single File’s Cache: On the “Caching” > “Configuration” page, use the “Custom Purge” feature to enter the specific URL(s) you need to refresh.








