Exactly what I needed, thanks!Question about banning mail domains (if I understand correctly), answers about banning countries from registration.
You may just a ban email domain via ACP and default feature:/admin.php?banning/emails
View attachment 282596
I think this is just for paid-for Cloudflare subscriptions - although correct me if I'm wrong. I have no option that I can see with my free Cloudflare subscription.If you are using Cloudflare you can create a rule for this:
![]()
Registration Country Ban via Cloudflare
Visit: https://dash.cloudflare.com/ Your XenForo Domain > Firewall Menu > Firewall Rules > Create a Firewall rule Rule name: Registration Country Ban Expression Preview > Edit expression Modify the country codes/domain: ip.geoip.country in...xenforo.com
Cloudflare Dashboard > Select Your Domain > Security > WAF > Custom Rules > Create Rule >I think this is just for paid-for Cloudflare subscriptions - although correct me if I'm wrong. I have no option that I can see with my free Cloudflare subscription.
So what is the best way to block certain countries if you have a free Cloudflare subscription? Eg AndyB's VPN blocking addon apparently doesn't work if you use Cloudflare
Change https://domain.com/register/ to your url((ip.geoip.country eq "AF") or (ip.geoip.country eq "AL") or (ip.geoip.country eq "DZ") or (ip.geoip.country eq "AO") or (ip.geoip.country eq "AI") or (ip.geoip.country eq "AG") or (ip.geoip.country eq "AW") or (ip.geoip.country eq "AZ") or (ip.geoip.country eq "BD") or (ip.geoip.country eq "BY") or (ip.geoip.country eq "BZ") or (ip.geoip.country eq "BJ") or (ip.geoip.country eq "BT") or (ip.geoip.country eq "BO") or (ip.geoip.country eq "BQ") or (ip.geoip.country eq "BW") or (ip.geoip.country eq "BG") or (ip.geoip.country eq "BF") or (ip.geoip.country eq "BI") or (ip.geoip.country eq "KH") or (ip.geoip.country eq "CM") or (ip.geoip.country eq "CF") or (ip.geoip.country eq "TD") or (ip.geoip.country eq "CN") or (ip.geoip.country eq "CZ") or (ip.geoip.country eq "DJ") or (ip.geoip.country eq "DO") or (ip.geoip.country eq "GQ") or (ip.geoip.country eq "ER") or (ip.geoip.country eq "EE") or (ip.geoip.country eq "ET") or (ip.geoip.country eq "SZ") or (ip.geoip.country eq "PF") or (ip.geoip.country eq "GA") or (ip.geoip.country eq "GM") or (ip.geoip.country eq "GH") or (ip.geoip.country eq "GP") or (ip.geoip.country eq "GU") or (ip.geoip.country eq "GW") or (ip.geoip.country eq "GY") or (ip.geoip.country eq "IN") or (ip.geoip.country eq "IR") or (ip.geoip.country eq "IQ") or (ip.geoip.country eq "KZ") or (ip.geoip.country eq "KE") or (ip.geoip.country eq "KI") or (ip.geoip.country eq "KR") or (ip.geoip.country eq "KG") or (ip.geoip.country eq "LA") or (ip.geoip.country eq "LR") or (ip.geoip.country eq "LY") or (ip.geoip.country eq "MO") or (ip.geoip.country eq "MG") or (ip.geoip.country eq "MW") or (ip.geoip.country eq "MY") or (ip.geoip.country eq "ML") or (ip.geoip.country eq "MN") or (ip.geoip.country eq "MZ") or (ip.geoip.country eq "MM") or (ip.geoip.country eq "NA") or (ip.geoip.country eq "NR") or (ip.geoip.country eq "NP") or (ip.geoip.country eq "NI") or (ip.geoip.country eq "NE") or (ip.geoip.country eq "NG") or (ip.geoip.country eq "NU") or (ip.geoip.country eq "OM") or (ip.geoip.country eq "PK") or (ip.geoip.country eq "PW") or (ip.geoip.country eq "QA") or (ip.geoip.country eq "RU") or (ip.geoip.country eq "RW") or (ip.geoip.country eq "SA") or (ip.geoip.country eq "SL") or (ip.geoip.country eq "SO") or (ip.geoip.country eq "SD") or (ip.geoip.country eq "SR") or (ip.geoip.country eq "SJ") or (ip.geoip.country eq "SY") or (ip.geoip.country eq "TW") or (ip.geoip.country eq "TJ") or (ip.geoip.country eq "TH") or (ip.geoip.country eq "TL") or (ip.geoip.country eq "TG") or (ip.geoip.country eq "TK") or (ip.geoip.country eq "TR") or (ip.geoip.country eq "TM") or (ip.geoip.country eq "TC") or (ip.geoip.country eq "UG") or (ip.geoip.country eq "AE") or (ip.geoip.country eq "UZ") or (ip.geoip.country eq "VN") or (ip.geoip.country eq "YE") or (ip.geoip.country eq "ZM") or (ip.geoip.country eq "ZW") or (ip.geoip.country eq "XX") or (ip.geoip.country eq "T1")) and (http.request.full_uri contains "https://domain.com/register/")
Thank you so muchCloudflare Dashboard > Select Your Domain > Security > WAF > Custom Rules > Create Rule >
Enter a title in rule name, click edit expression, in the enter the countries you want to block, for example....
Change https://domain.com/register/ to your url
Choose Action - Block (or you may wat to challenge)
Place At: when you want the rule to be applied (Start, Finish, Custom (if you have other rules))
Click Deploy.
I think this is just for paid-for Cloudflare subscriptions - although correct me if I'm wrong. I have no option that I can see with my free Cloudflare subscription.
So what is the best way to block certain countries if you have a free Cloudflare subscription? Eg AndyB's VPN blocking addon apparently doesn't work if you use Cloudflare
According to AI, ip.src.country is better as it says ip.geoip is deprecated?When I've entered Country equals and selected the country, it pre-populates the expression like this
(ip.src.country eq "RU")
Is this ok or do I need to edit it to ip.geoip.country eq "RU" - as in the post above?
Change https://domain.com/register/ to your url
Thank you. I'll take a look at thatIf you use this fabulous addon, There is an option to block both visits and registrations or both from countries you want.Configure and manage your Cloudflare account from within XenForo.
Hi. I'm just a little confused now. At the bottom it says about an API call and an API token and some code in the drop down box. I had clicked save so assume it's all done? But do I need to do anything about an API token?Cloudflare Dashboard > Select Your Domain > Security > WAF > Custom Rules > Create Rule >
Enter a title in rule name, click edit expression, in the enter the countries you want to block, for example....
Change https://domain.com/register/ to your url
Choose Action - Block (or you may wat to challenge)
Place At: when you want the rule to be applied (Start, Finish, Custom (if you have other rules))
Click Deploy.
I don't actually use this as my site is invite only, so cannot confirm 100%, but I think go back to the WAF page and click Custom Rules it should bring up any rules you've created. You should be able to edit the rule and also make sure it is enabled.Hi. I'm just a little confused now. At the bottom it says about an API call and an API token and some code in the drop down box. I had clicked save so assume it's all done? But do I need to do anything about an API token?
Thanks - yes I was just looking at thatIf you want a simpler way that gives you more control - including forcing registrations from certain countries to go to moderation for approval, try my addon:
Ban or moderate users from specific countries when registering using Maxmind's GeoLite2 Database
- Sim
- geoblocking geoip geolite2 maxmind registration
- Add-ons [2.x]
We use essential cookies to make this site work, and optional cookies to enhance your experience.