WPLake > Blog > CloudFlare in WordPress, How to Setup
  • Deutsch
  • Español
  • Français
  • Italiano

CloudFlare in WordPress, How to Setup

Time to read: 2 mins


Plugins Tips and Tricks Tutorials


Updated 12.07.23

A short guide for connecting CloudFlare in WordPress. Learn how to setup CloudFlare, what a CDN is and where to see the speed results.
cloudflare is the catalyst for page speed

Table of Contents

A short guide for connecting CloudFlare in WordPress. Learn how to setup CloudFlare, what a CDN is and where to see the speed results.

What is a CDN?

#link copied

A CDN is a network of servers spread across different locations, delivering web content to users from the closest server, resulting in faster page load times and improved user experience.

Benefits of using CloudFlare in WordPress

#link copied

Using a CDN offers several benefits. Firstly, it improves website performance by delivering content from servers closer to users, reducing latency and enhancing page load times. Secondly, it enhances scalability and can handle high traffic loads efficiently. Thirdly, it provides better reliability with failover capabilities and load balancing. Fourthly, it optimizes bandwidth usage by serving cached content directly to users. Additionally, CDNs offer enhanced security features like DDoS protection and encryption. Overall, CDNs optimize website performance, improve user experience, ensure availability, and provide additional security layers.

cloudflare dns settings
Modify your DNS records within CloudFlare.

Create an account on CloudFlare

#link copied
  1. Sign up for a CloudFlare account: Go to the CloudFlare website (cloudflare.com) and sign up for a free account if you don't have one already.
  2. Add your website to CloudFlare: After signing up, add your WordPress website to CloudFlare by clicking on the "Add a Site" button and entering your website's domain name. CloudFlare will scan your DNS records and import them automatically.
  3. Review and update DNS records: CloudFlare will show you a list of your DNS records. Ensure that all essential records are imported correctly, such as your domain's A, CNAME, and MX records. Verify that the records match your original DNS configuration.
  4. Select a CloudFlare plan: CloudFlare offers different plans, including a free plan with basic features. Choose the plan that suits your needs and budget. You can always upgrade later if necessary.
  5. Update nameservers: After selecting a plan, CloudFlare will provide you with two nameservers. Change your domain's nameservers to the ones provided by CloudFlare. You can typically do this in your domain registrar's settings.
  6. Configure CloudFlare settings: Once the nameservers are updated, go back to the CloudFlare dashboard and configure the desired settings. Some recommended settings for WordPress include:
    • SSL: Enable "Full" SSL encryption to secure your website.
    • Caching: Enable "Caching Level" to determine how CloudFlare caches your content. You can start with the "Standard" option.
    • Automatic HTTPS Rewrites: Enable this option to ensure that all HTTP links on your website are automatically rewritten to HTTPS.
    • Page Rules: Set up specific rules to customize the behavior of CloudFlare for different pages or URLs.
Cloudflare domain active
Once the Nameservers have propagated the domain becomes active.

Connecting CloudFlare in WordPress

#link copied

It's worth noting, that you can skip the installation of the plugin, if you're using the CloudFlare Free Plan.

  1. Install the CloudFlare plugin for WordPress: To integrate CloudFlare with WordPress, install the official CloudFlare plugin. Go to your WordPress admin dashboard, navigate to "Plugins," click on "Add New," and search for "CloudFlare." Install and activate the plugin.
  2. Connect the CloudFlare plugin with your CloudFlare account: After activating the plugin, go to "Settings" and click on "CloudFlare." Enter your CloudFlare email address and API key (which you can find in your CloudFlare account settings) to connect the plugin with your CloudFlare account.
  3. Configure the plugin settings: Once connected, the CloudFlare plugin will provide various configuration options. Review the settings and choose the desired options for your website.
  4. Clear cache and test your website: After completing the setup, clear any caching plugins or mechanisms you have in WordPress, and purge the cache in CloudFlare. This ensures that your visitors will see the updated content. Test your website thoroughly to ensure everything is working correctly.

With these steps, you can successfully set up CloudFlare CDN with your WordPress website, which will help improve its performance, security, and overall user experience.

In summary; CloudFlare CDN (Free): is for static files (like images, CSS and JS), CloudFlare APO (paid, 5$/domain) for WordPress. It's with the Paid plans where you'd require to have the plugin installed.

Now let’s see some results.

cloudflare caches and protects
Connect your site to CloudFlare Free CDN in WordPress.

Testing the difference

#link copied

Visit page speed and see how your FCP and Other speed metrics have improved.

If you haven’t seen the speed improvement you expected, perhaps try some of our other pro tips for speed optimization.

About the Author
Baxter Jones

Working in the web industry for over 15 years gaining experience in design,user experience and web best practices. Has a keen eye for detail and enjoys having a process when working and creating. He thinks WordPress is the best thing since sliced bread and when he’s not behind his computer he’ll be in the garden.


    Leave a comment

    Reply to 

    Please be considerate when leaving a comment.

    Not shown publicly

    Got it