A guide to setting up Cloudflare on your WordPress site
What is Cloudflare and why use it?
Cloudflare sits between your web server and the rest of the internet and diverts web traffic to their network. Cloudflare will then divert traffic to their network instead of directly to the origin server.
Cloudflare can cache static web content and screen visitors to ensure that they are good rather than coming from an attack or a malicious bot. Because CloudFlare’s network comprises 32 global data centers, your clients can access your content very quickly no matter how far away your origin server is.
Should you consider Cloudflare or stick with NitroPack?
Cloudflare and NitroPack have distinctive advantages. Cloudflare focuses on speed and security, while NitroPack focuses on speed. Specifically, NitroPack provides a comprehensive page speed optimization service with caching, CDN, image optimization and script optimization, resulting in a 90+ Desktop PageSpeed Score.
Cloudflare protects against SQL injections and identity theft, among other things. Cloudflare improves site performance and speeds up page load times by using its global network of data centers. When your website visitor connects to CloudFlare’s network, they are redirected to the nearest server. Because of this, the closer the data center is to the user, the quicker your website loads (this is especially important for high-volume sites dependent on a global audience/readership pool).
Useful Cloudflare features for WordPress sites
Here’s a table of features that help with optimizing your WordPress site:
|Feature||Why it is useful|
|SSL||SSL encrypts internet connections to ensure information is safeguarded as it is transferred between systems. When you see a padlock icon next to the URL in the address bar, SSL is protecting the website you are visiting.
CloudFlare offers several modes when dealing with SSL/TLS encryption:
|DNS||Any online business relies on DNS to function. CloudFlare DNS is an enterprise-grade DNS service that provides the fastest response times, unrivalled redundancy, advanced security and built-in DDoS protection and DNSSEC. CloudFlare will replace and manage your existing DNS provider.|
|Security||Offers security services to protect and secure web properties from denial-of-service attacks, customer data breaches and malicious bots.
CloudFlare offers a number of security tools:
|DDoS protection||Automatically detects and mitigates Distributed Denial of Service (DDoS) attacks using its Autonomous Edge. CloudFlare DDoS Protection Managed Rulesets expose multiple dynamic mitigation rules.|
|Image optimization||Provides a secure and efficient image delivery service using CloudFlare servers to store, resize, optimize and deliver images.
For example, before using the image optimization service, stock site CMSs typically do not support next gen images like WebP.
How Cloudflare helps with technical SEO
Quality content, user experience and not making things more difficult for search engine crawlers are all crucial to SEO in practice. Cloudflare features can improve Search Engine site rankings, but having meaningful and frequently updated site content is still crucial to improving SEO.
Cloudflare offers a number of features that when enabled can optimize site performance:
- Image Resizing: allows you to adapt images to your site’s layout and your visitors’ screen sizes without maintaining a server-side image processing pipeline.
- Polish: optimizes images by converting them to more optimized formats such as WebP.
- Brotli: speeds up page load times by compressing content using the Brotli compression.
- Early Hints: having Crawler Hints on your website ensures that search engines and other bot-powered experiences have the most up-to-date version of your content, resulting in happier users and, in turn, influencing search rankings.
- Enhanced HTTP/2 Prioritization: optimizes the order of resource delivery, independent of the browser.
- TCP Turbo: reduces latency and increases throughput with custom-tuned TCP optimizations.
- Automatic Signed Exchanges (SXGs): improves site performance by making cacheable resources available on Google’s Signed Exchanges.
- Prefetch URLs: CloudFlare will prefetch any URLs included in the prefetch HTTP header.
Steps to set up Cloudflare on WordPress
Before getting started, visit Cloudflare and create an account.
- Login to Cloudflare
- Go to Websites
- Click Add Site and enter your domain and click Add site
- Select a plan and click Continue
- Review your DNS records and click Continue
- Make note of the nameservers, they will be required when changing the nameservers in your domain provider
- Login to your domain provider, go to your domain’s DNS settings and locate nameservers
- Edit the nameservers and change them to the nameservers noted in step 6
- Go back to Cloudflare and click on Check nameservers (Note that this step could take up to 24 hours to validate)
Installing the WordPress plugin
To Configure WordPress to work with Cloudflare, you’ll first need to install the Cloudflare plugin.
- Log in to your WordPress dashboard
- Navigate to Plugins
- Search for Cloudflare and click Install Now
- Click Activate
Configure the Cloudflare plugin
- Open a browser and navigate to Cloudflare, login and go to API tokens under profile
- Click on the View next to the Global API Key, enter your password to reveal the key and make note of this key
- Go to Settings and then Cloudflare
- Click on Sign in here, enter your email and the Global API key and click Save API Credentials
- You are now connected to Cloudflare, click Apply recommended Cloudflare settings for WordPress
Cloudflare Automatic Platform Optimization for WordPress
Cloudflare’s edge network and caches third-party fonts for Automatic Platform Optimization for WordPress ensure optimum performance for your site. You don’t have to alter how you manage your website to gain the benefits of a static site. TTFB and content load faster as a result of consistent, fast content delivery.
To enable this feature:
- Log in to WordPress
- Go to Settings and then Cloudflare
- Scroll to Automatic Platform Optimization and turn it On
Cloudflare Argo and Railgun
Cloudflare offers two optimization features: Argo and Railgun.
- Argo reduces bandwidth costs, improves reliability, and shortens page load times by taking advantage of CloudFlare’s optimized routes. Argo Smart Routing can be activated by enabling the feature, resulting in a 30% reduction in Internet latency and a 27% reduction in connection errors on average.
- Railgun technology caches frequently accessed resources, ensuring that visitors to the site receive fast page loads. Railgun caches and accelerates uncacheable website content, ensuring that, even when the origin server must be accessed, visitors still receive fast page loads. It even works with dynamic webpages like news sites or personalized content.
Frequently asked questions
How does Cloudflare provide DDoS protection?
CloudFlare’s Autonomous Edge and centralized DDoS systems analyze traffic samples “out-of-path” to detect and mitigate DDoS attacks. Asynchronously detecting DDoS attacks without latency or performance issues is achieved by analyzing traffic samples “out-of-path.”
Cloudflare: is their free version enough?
For small hobby websites, the free plan is enough. It offers CloudFlare’s unmetered DDoS protection as well as some of the speed optimization features such as static content caching. However, for larger websites, it is recommended to upgrade to a paid plan, which provides access to a wider range of Cloudflare features such as image optimization.
Large businesses and enterprise users would benefit greatly from moving to a business or enterprise plan.
Can Cloudflare hurt a website’s SEO or Google Rankings?
Cloudflare can significantly improve the performance of your website if you choose to use it. It can also help improve your SEO efforts. It may, on the other hand, negatively impact your SEO if it is used improperly. You may experience issues with link checkers, time delays on fast servers or Cloudflare reporting your site as down, just to name a few. You may want to give Cloudflare a try if the benefits outweigh the negatives.