Skip to Content

How to Protect WordPress Site from Attacks and Improve Performance with CloudFlare

  • CloudFlare sits between your site and the internet, providing powerful security and performance tools through its global network. Enabling the proxy service unlocks the full benefits.
  • Block unwanted traffic like XML-RPC and suspicious login attempts using CloudFlare rules. This improves security and speeds up your site.
  • For WordPress sites targeted by attacks, CloudFlare can dramatically enhance performance by reducing strain on server resources. This helps prevent premature hosting upgrades.

Secure your WordPress site and speed it up using CloudFlare’s powerful tools for blocking threats and reducing resource usage.

Problem

Keeping your WordPress site safe from hackers and running fast are top priorities for any site owner. Recent malware attacks have highlighted the need for better security. Meanwhile, optimized performance ensures a smooth experience for visitors. This guide covers two easy ways to leverage CloudFlare to both protect your site and improve speed by reducing strain on your server resources.

Solution 1: Disable XML-RPC in WordPress

XML-RPC is a feature that allows remote APIs to communicate with your WordPress site. Most sites don’t need it active. Unfortunately, XML-RPC can be exploited by attackers to compromise your site. Disabling it improves security.

To disable XML-RPC:

Step 1: In the CloudFlare dashboard, go to Security > WAF (Web Application Firewall)

In the CloudFlare dashboard, go to Security > WAF (Web Application Firewall)

Step 2: Create a rule blocking URI containing “xmlrpc

Create a rule blocking URI containing “xmlrpc”

Step 3: Deploy the rule

Blocking XML-RPC prevents unneeded traffic from reaching your server. This lightens the load and frees up strained resources.

Solution 2: Scrutinize Login Attempts

Login pages are a prime target for brute force attacks. CloudFlare can add an extra layer of protection by scrutinizing every login attempt.

To activate:

Step 1: Create a page rule in CloudFlare for your /wp-login.php URL

Create a page rule in CloudFlare for your /wp-login.php URL

Step 2: Set the Security Level to “I’m Under Attack

Set the Security Level to “I’m Under Attack”

This subjected all login traffic to maximum scrutiny, blocking suspicious access attempts.

Conclusion

CloudFlare puts powerful protections within reach for any WordPress site owner. Try these steps to secure your site and speed it up. Let us know in the comments if you have any other questions!

Disclaimer: This article provides general information and suggests possible solutions to improve WordPress security and site performance. However, results may vary based on your specific site configuration and needs. We recommend working with a qualified technician to implement any major site changes, especially related to security. This article should not be taken as professional legal, security, or technical advice.