Cloudflare can make a WordPress site faster and safer for free. It can also cause redirect loops, broken logins, and a cached shopping cart showing someone else’s items — if it’s set up carelessly. The difference comes down to a handful of settings.
This guide shows how to run WordPress with Cloudflare the right way: why the pairing works, how to connect your domain, which SSL settings to use, caching rules for WordPress, and security features worth enabling.
New to CDNs? Start with What Is a CDN and Does Your Site Need One?.
www) to Proxied (orange cloud). Keep mail-related records DNS only (grey cloud).Weighing Cloudflare against your registrar’s DNS? See Cloudflare DNS vs Registrar DNS: Which Should You Use?.
This is where most problems happen. Under SSL/TLS → Overview:
Make sure both URLs in WordPress Settings → General use https://. Need a certificate on your host first? Read What Is SSL? How to Get HTTPS for Free.
By default, Cloudflare caches static files but not HTML pages. If you add full-page caching, you must bypass the cache for:
/wp-admin/* and /wp-login.phpwordpress_logged_in)Easier options: Cloudflare’s APO for WordPress (a paid add-on that handles these rules automatically) or a caching plugin with Cloudflare integration. Purge the Cloudflare cache after major design changes. For plugin options, see Best WordPress Caching Plugins Compared.
Also install the official Cloudflare plugin or configure your server so WordPress sees real visitor IPs instead of Cloudflare’s. Many hosts do this automatically; otherwise security plugins and comment logs may show only Cloudflare addresses.
/wp-login.php from countries where you have no staff.We may earn a commission on purchases made through these links, at no extra cost to you.
Don’t miss the chance to participate in the biggest giveaway of this year.