Speed & performance · Guide
How to Set Up Cloudflare for WordPress (Settings That Matter)
Short answer
To set up Cloudflare for WordPress, create a free Cloudflare account, add your domain, and change your nameservers at your registrar to the 2 Cloudflare nameservers. Set SSL/TLS to Full (strict), turn on Always Use HTTPS, then install the official Cloudflare plugin and connect it with a WordPress API token.
Key takeaways
- Cloudflare gives you 2 nameservers to set at your registrar, and the change can take up to 24 hours.
- Use Full (strict) SSL so both legs of the connection are encrypted and your origin certificate is checked.
- The one-click WordPress setup sets caching to Standard and browser cache TTL to 4 hours.
- APO costs $5 per month on the Free plan as of November 2026 and is included in paid plans.
- The official Cloudflare plugin needs PHP 7.4 or higher and does not support multisite WordPress.
- Purge a single file after a change instead of purging everything, so the rest of the cache stays warm.
What does Cloudflare do for a WordPress site?
Cloudflare sits between visitors and your host, serving cached files, handling DNS and adding HTTPS at the edge.
A content delivery network is a set of servers around the world that serve copies of your files from a location near each visitor. Cloudflare also acts as your DNS provider once you change nameservers, so it answers the lookups that point visitors to your site.
By default, Cloudflare caches static files such as images, CSS and JavaScript. It does not cache your HTML pages by default, so each page view still runs PHP on your host until you add full-page caching. That detail matters when you judge speed after setup, and Cloudflare cache rules for WordPress cover the next step.
Cloudflare also adds a free Universal SSL certificate at the edge and a managed ruleset that blocks common attacks before they reach WordPress. It does not replace a backup, a security plugin or updates, and it does not host your site.
What do you need before you start?
You need a live self-hosted WordPress site, access to your domain registrar, access to your host, and a valid SSL certificate on your host.
Start with a backup of your site and database, because a DNS or SSL change can take a site offline if a record is wrong. If you have no backup routine yet, read how to back up WordPress first and keep a copy you can restore.
You also need your registrar login, because only the registrar can change nameservers. Keep your host login ready too, so you can check the origin certificate and the server IP address for your DNS records.
Check your WordPress version and PHP version in WordPress under Tools, then Site Health, then Info. WordPress.org recommends PHP 8.3 or greater as of November 2026, while the official Cloudflare plugin needs PHP 7.4 or higher, so an old PHP version can block the plugin step.
How do you add your site to Cloudflare and change nameservers?
You add your domain in the Cloudflare dashboard, review the DNS records it finds, then replace your nameservers at your registrar with the 2 Cloudflare nameservers.
Follow these steps in order:
- Create a free Cloudflare account and select Add a domain.
- Enter your root domain, such as example.com, without a scheme or a page path.
- Pick the Free plan unless you already know you need a paid plan.
- Let Cloudflare scan your current DNS records and check each A, AAAA and CNAME record against your host.
- Copy the 2 nameservers Cloudflare shows you, exactly as written.
- At your registrar, remove your old nameservers and add the 2 Cloudflare nameservers.
- Return to Cloudflare and wait for the zone to show as Active.
A full setup is the most common Cloudflare setup, and Cloudflare's full setup guide says it is the only setup available for Free or Pro plans. If your domain has DNSSEC active, turn it off at your registrar before you change nameservers, because changing nameservers while DNSSEC is active can make your domain unreachable.
The registrar update can take up to 24 hours, according to Cloudflare's full setup guide. Most changes show sooner, but do not judge the setup until that window has passed. How long DNS propagation takes explains why different visitors see the change at different times.
Which DNS records should be proxied and which should stay DNS only?
Proxy the records for your website, such as the root domain and www, and leave records that are not web traffic as DNS only.
Cloudflare shows a proxy status for each DNS record. A proxied record, shown with an orange cloud, passes through Cloudflare, so visitors get cached files, HTTPS at the edge and attack filtering. A DNS only record, shown with a grey cloud, points straight to your host.
Check each record after the scan. The root A record and the www CNAME or A record should point to your host IP address or hostname and be proxied. If a record is wrong, fix it in Cloudflare under DNS, then Records, before you change nameservers.
Leave any record your host tells you to keep DNS only as DNS only. A wrong proxy choice can break a service that does not use HTTP, while a wrong IP address can take the whole site down. If you are unsure about a record, ask your host which records must stay DNS only.
How do you set SSL to Full (strict) and turn on Always Use HTTPS?
Set SSL/TLS to Full (strict) in the Cloudflare dashboard, then turn on Always Use HTTPS under Edge Certificates.
Cloudflare's SSL mode controls 2 connections: visitor to Cloudflare, and Cloudflare to your host. Cloudflare's encryption modes guide says Cloudflare strongly recommends Full or Full (strict) when possible, because Flexible leaves the second connection unencrypted.
Full (strict) mode encrypts both connections and checks your origin certificate. Your host must allow HTTPS on port 443 and present an unexpired certificate from a publicly trusted authority or Cloudflare Origin CA, with a name that matches your hostname.
If your host has no valid certificate, install one first. Many hosts offer a free Let's Encrypt certificate, and Let's Encrypt provides free TLS certificates to sites that can show control of their domain.
Cloudflare also offers a free Origin CA certificate that lasts up to 15 years and is trusted by Cloudflare, so you can use Full (strict) after you install it on your host.
After the mode is set, open SSL/TLS, then Edge Certificates, and turn on Always Use HTTPS. That setting redirects every HTTP request to HTTPS at the edge. Cloudflare's HTTPS guide also lists setting the minimum TLS version to 1.2 as part of the same HTTPS setup.
In WordPress, open Settings, then General, and check that both the WordPress Address and Site Address start with https://. If either still starts with http://, fix it before you judge the SSL setup. For the full SSL detail, see Cloudflare SSL settings for WordPress.
How do you install and connect the official Cloudflare plugin?
Install the official Cloudflare plugin from Plugins, then Add New, then connect it with a WordPress API token from your Cloudflare account.
The plugin is not needed for the basic proxy and DNS setup, but you need it to apply the one-click WordPress settings, to purge cache from WordPress, and to use APO. The plugin page on WordPress.org says the plugin needs PHP 7.4 or higher.
Follow these steps:
- In WordPress, open Plugins, then Add New.
- Search for Cloudflare and install the plugin by Cloudflare, Inc.
- Select Activate.
- In the Cloudflare dashboard, open your Account API Tokens page.
- Select Create Token, find the WordPress template and select Use template.
- Select Continue to summary, then Create Token, and copy the token.
- In WordPress, open the Cloudflare plugin Settings and sign in with an existing account.
- Enter your email address, paste the token, and select Save API Credentials.
Cloudflare's plugin activation guide lists these exact steps, and it warns that the plugin does not support multisite WordPress. Keep the token private and do not paste it into a post, a comment or a shared screenshot.
If you plan to use APO, buy it first on the Free plan. Cloudflare's plugin activation guide says Free-plan users should purchase APO before installing the plugin, while Pro-plan or higher users can continue to install the plugin.
APO costs $5 per month on the Free plan as of November 2026, and the plugin page on WordPress.org says it is free for paid-plan users. See is Cloudflare APO worth it for WordPress before you pay for it.
Which settings should you apply with the one-click WordPress setup?
Click Apply for Apply Recommended Cloudflare Settings for WordPress in the plugin, which sets caching to Standard and browser cache TTL to 4 hours.
The one-click setup is the fastest way to apply the settings Cloudflare lists for WordPress. Cloudflare's support page for the one-click setup lists the exact values it applies.
| Setting | Value applied |
|---|---|
| Caching level | Standard |
| Browser Cache TTL | 4 hours |
| Always Online | On |
| Development Mode | Disabled |
| IPv6 Compatibility | On |
| WebSockets | On |
| IP Geolocation | On |
| Email Address Obfuscation | On |
| Hotlink Protection | Off |
| Image optimization (Polish) | Off, unless on Pro or higher |
| Rocket Loader | Off |
Browser Cache TTL is the time a browser may reuse a cached file before it asks again, so 4 hours is a middle value that helps repeat visits without freezing changes for a day. Always Online shows a cached copy if your host goes down, while Development Mode, when on, bypasses the cache for testing.
Leave Rocket Loader off unless you have a clear reason to turn it on, because it changes how JavaScript loads and can break scripts. Leave Hotlink Protection off unless you want to block other sites from embedding your images directly.
If you use APO, turn off WP Rocket, W3 Total Cache or a similar caching plugin when you first set up APO.
Cloudflare's plugin activation guide gives that warning, because running APO with another full-page cache can cause odd results. After you confirm APO works, test whether turning the other plugin back on helps or causes problems.
How do you check Cloudflare is working?
Check that your site loads over HTTPS, the Cloudflare dashboard shows your zone as Active, and a purge test returns a cache MISS on the next request.
Start with the simple checks. Open your home page in a fresh browser window and look for the padlock in the address bar and no mixed-content warning. Open a post, a page and your login page, and check that each one loads and that the login page still works.
Next, check the dashboard. Open the zone Overview page in Cloudflare and confirm the status is Active. If it still shows Pending, your nameservers have not finished changing yet, so wait and check again after a few hours.
Then check the cache. In your browser tools, open the Network tab, reload a static file such as an image, and look for the CF-Cache-Status response header. A value of HIT means Cloudflare served it from cache, while MISS means it fetched it from your host.
If you change a file and the old copy still shows, purge that one file. Cloudflare's single-file purge guide says to open Configuration, then Purge Cache, then Custom Purge, then pick URL.
Cloudflare's purge-everything guide says purging everything clears all cached content in all data centers, and the next request for each resource returns MISS, so use a single-file purge first.
How long does setup take and what does it cost?
The dashboard steps are short, but the full setup is not done until the nameserver change finishes, which can take up to 24 hours.
Do not change nameservers again during that window, and do not cancel your old DNS service until Cloudflare shows the zone as Active. If you edit DNS records in the old provider after the change, those edits will have no effect, because Cloudflare is now the DNS provider.
The core setup costs $0 on the Free plan as of November 2026. Cloudflare's plans page lists Free at $0, Pro at $20 per month billed annually or $25 billed monthly, and Business at $200 per month billed annually or $250 billed monthly, with each plan priced per zone.
APO is the main paid add-on for WordPress on the Free plan, at $5 per month as of November 2026. Decide on APO after the basic setup works, not before, so a caching problem is easier to trace. For a plan comparison, see Cloudflare Free vs Pro for WordPress.
HTTPS is part of the value here, not just a padlock. web.dev says HTTPS protects site integrity and user privacy, stops intruders from tampering with traffic, and is required for many new browser features.
What mistakes should you avoid?
The most common setup errors are Flexible SSL, a missing origin certificate, a wrong DNS record and 2 caching plugins fighting each other.
Avoid these mistakes:
- Do not use Flexible SSL on a WordPress site, because it leaves the Cloudflare-to-host connection unencrypted and often causes a redirect loop.
- Do not switch to Full (strict) before your host has a valid certificate, because Cloudflare will fail to check the certificate and visitors will see an error.
- Do not copy nameservers by hand from memory; copy them exactly from the Cloudflare dashboard.
- Do not turn off DNSSEC after you change nameservers; turn it off before the change and re-enable it through Cloudflare after activation.
- Do not run APO and a full-page caching plugin at the same time on day 1; test one cache layer first.
- Do not purge everything after every small edit; purge the single changed file instead.
- Do not skip the backup step, because a DNS mistake is much easier to fix when you can restore the site.
Frequently asked questions
Do I need the Cloudflare plugin to use Cloudflare with WordPress?
No. The proxy, DNS and edge SSL work without any plugin once your nameservers point to Cloudflare. You need the official plugin to apply the one-click WordPress settings, to purge cache from WordPress, and to use APO, which caches full HTML pages at the edge.
How long does it take for Cloudflare nameservers to work?
It can take up to 24 hours for a registrar to update nameservers, though many changes show sooner. During that time some visitors will reach the old DNS and some will reach Cloudflare. Wait until the Cloudflare dashboard shows your zone as Active before you judge the setup.
Why does my WordPress site show too many redirects after Cloudflare?
The usual cause is Flexible SSL. In that mode Cloudflare talks to your host over plain HTTP while WordPress redirects to HTTPS, so the redirect repeats. Install a valid certificate on your host, switch the Cloudflare mode to Full (strict), and check that both WordPress addresses start with https.
Is Cloudflare free enough for a small WordPress site?
Yes for most small sites. The Free plan at $0 as of November 2026 includes DNS, the CDN, unmetered DDoS protection, a Universal SSL certificate and the free managed ruleset. You pay extra only for add-ons such as APO, or for a paid plan if you need image optimization, more rules or ticket support.
Can I use Cloudflare on WordPress.com?
It depends on your WordPress.com plan. Free and lower-tier WordPress.com plans do not let you change nameservers or install plugins, so this setup does not apply. You need a self-hosted WordPress.org site, or a WordPress.com plan that allows plugins and custom DNS, before you follow these steps.
What should I do first if my site goes down after changing nameservers?
Check the DNS records in Cloudflare first, especially the root A record and the www record, and confirm they point to the correct host IP address. Check that your origin certificate is valid and that SSL is set to Full (strict). If the records are wrong, fix them in Cloudflare and wait for the change to spread.
Sources
- Change your nameservers (Full setup) Cloudflare Docs
- Encryption modes Cloudflare Docs
- Full (strict) - SSL/TLS encryption modes Cloudflare Docs
- Activate the Cloudflare WordPress plugin Cloudflare Docs
- What settings are applied when I click Optimize Cloudflare for WordPress Cloudflare Docs
- Cloudflare - WordPress plugin WordPress.org
- Why HTTPS matters web.dev
- Cloudflare plans Cloudflare
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
