How to Block Countries from Accessing Your WordPress Website

This updated guide keeps the original Cloudflare workflow and improves change safety and verification.Implementation ChecklistConfirm DNS records and proxy intentAlign SSL mode with origin cert statePrevent redirect loops at one…

Like many of the websites I manage, this block sees quite a bit malicious traffic from Russia and China.

Assuming that you are using CloudFlare. Here is how to add firewall rules to block these countries from accessing your website.

First go to Firewall and Create a Firewall Rule

Next name your rule.
Select Country, Value China, And, Country, Value Russian Federation, Action Block, and Click Deploy.

You now are blocking Russia and China from accessing your WordPress Site. After a couple days check back to Cloudflare under the Firewall settings and you can see how effective your rules are by looking at the activity over the last 24hr.

Validation Commands

curl -I https://www.wordpresshosting.solutions/
curl -I https://adkmesh.com/
sudo tail -n 120 /var/log/apache2/error.log

Further reading: Cloudflare Full (Strict) SSL Mode

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *