Block a Country with Cloudflare FREE?

Alf85

Elite Member
Joined
Sep 7, 2021
Messages
2,588
Reaction score
918
Hello everyone, I want to block certain countries that do not bring any benefit to my website and I read this guide:
https://www.alphr.com/block-country-cloudflare/
I performed a test on a TEST site I have and it works, but my big question is the following. For example if I block India, the google bot of India would not work... but if the google bot of USA, is it like this?

Thanks
 
Any?
 
For the prevention of bots try RECAPTCHA or if you clock the certain countries excluding those rest would work
 
It's not only about the bots, I'm also interested in not having traffic from certain countries that don't pay for advertising from these third tier countries.
 
if someone wants to see your web, he will see it by s vpn or any other third door
so you can restrict the website not showing to certain countries but the traffic may b some from there.
or you can check this article: https://www.sitepoint.com/how-to-block-entire-countries-from-accessing-website/
 
Ok I will read that guide. I understand that with VPN they can still enter but I would like to block traffic from China and India, the method you shared from Cloudflare would work right? And it would not affect the google bot from USA.
 
I don't find anything in my website it should be not done with yoy as well
 
You need to make a WAF rule in cloudflare to whitelist any user agent that has the word google in it if you want googlebot to be allowed through the firewall unconditionally.

I disagree with using captcha on your website to block traffic. If you want to block any traffic from undesirable countries it is best to do it using a firewall. Doing so will prevent your server resources from being consumed. Using captcha still allows the bots and humans to use your bandwidth.
 
Last edited by a moderator:
do u really need cloudflare to do this? i thought you can do this on your server side of things. geoip redirect.

google crawler bot will very likely not be impacted in either scenario.

i would not worry about people with vpn/proxy. wild guess that is 1% of that country traffic.
 
You need to make a WAF rule in cloudflare to whitelist any user agent that has the word google in it if you want googlebot to be allowed through the firewall unconditionally.

I disagree with using captcha on your website to block traffic. If you want to block any traffic from undesirable countries it is best to do it using a firewall. Doing so will prevent your server resources from being consumed. Using captcha still allows the bots and humans to use your bandwidth.
Do you know the rule for authorizing google bot?

do u really need cloudflare to do this? i thought you can do this on your server side of things. geoip redirect.

google crawler bot will very likely not be impacted in either scenario.

i would not worry about people with vpn/proxy. wild guess that is 1% of that country traffic.
I don't know if my server (Cloudways) allows this, I will ask them.
 
Do you know the rule for authorizing google bot?


I don't know if my server (Cloudways) allows this, I will ask them.
Yes. The rule is:

User Agent contains googlebot
Allow
 
Thanks i will check. I understand that there would be two rules, one to block countries and another to allow google bot, right?
 
Thanks, I will check right now if the FREE version allows to block traffic by country.
 
Back
Top