As a novice, how do I block everything (guests) by country?

Elisabeth_K

Member
Licensed customer
My forum at https://citadel-81/xen just turned 3 months old. Up until last week we had 3 to 12 guests at any one time. Now we're seeing 120 to 195 and I would like to stop this before it gets worse. There's no reason Brazil, Argentina, China, Singapore, etc. need to be hitting my site at all. I've got most of the well behaved robots blocked that follow robots.txt. except Baidu that's being stubborn. I do not care about SEO or if good robots get blocked.

I've read through multiple threads here about stopping guests but some are 50 pages long. Figuring out where to start is challenging and these long threads are interspersed with technical information that's too over my head to condense into some kind of actionable plan. I don't want guests from these countries to receive a challenge, I just want them blocked entirely. I also don't want to lock everything down so only registered members can view our content.

I've read about Cloudflare but the information about how to set it up is all over the place and their site isn't particularly helpful for non-techies trying to get started either. I've also read about the Bot Guard add-on but don't know if I need that or need both? I've read about adding things to the htaccess file but the information is scattered and inconsistent.

Can some provide a "for Dummies" summary of where to get started with all of this?

Thank you.
 
To block countries from accessing your forum it is either
• Cloudflare (free)
• a firewall on your server (independent from the forum)
• IP Threat Monitor (Paid Add On)
• Block Country (Paid Add On)

Blocking countries may linder the guest problem massively but clearly does not solve it and possibly (depending from the implementation) creates a bunch of new problems.

I've read through multiple threads here about stopping guests but some are 50 pages long. Figuring out where to start is challenging and these long threads are interspersed with technical information that's too over my head to condense into some kind of actionable plan.
Well, it is not an easy topic and therefore pretty complex to deal with and ways differ depending from what one wants to achieve.

Can some provide a "for Dummies" summary of where to get started with all of this?
The two add ons are the simplest way, IP Threat monitor is the more powerful solution of the two. However, neither will on it's own solve the guest problem.
 
To block countries from accessing your forum it is either
• Cloudflare (free)
• a firewall on your server (independent from the forum)
• IP Threat Monitor (Paid Add On)
• Block Country (Paid Add On)

Thank you for the suggestions. I reviewed both products and decided on IP Threat Monitor. It took a bit to get purchased and all setup needing two different API keys and at first it wasn't doing anything. I contacted the developer and received a quick response with suggestions of what settings to change to get it all working and now it is definitely performing as expected.
 
I looked at XF Bot Guard and considered it but with 52 pages of spread out information, I was overwhelmed. so I went with IP Threat Monitor in spite of its price tag because it does block by country. I had some questions after installation that were promptly answered by the developer.

With the right two API keys from external sources, it even detects VPN users from blocked countries trying to mask where they're coming from. That's pretty slick, IMO.

I've had this running most of the day, monitoring where guests were coming from and blocking their country. It's like playing whackamole but so far we've blacklisted 120 IPs.

Guests from these countries are blocked with more being added every hour. It would almost be easier to have an allow list and block everything else. :)

1786922545935.webp

In a couple days I'll probably have most of the world blocked. Why anybody even cares about my small baby forum is beyond me but I'm happy to feel like I'm doing something about it.
 
You get 4 free country code blocks from cloudflare.

You may also filter out AI bots if you prefer.

Update your robots.txt to include certain bots from countries that don't concern your site.

A good starting point. But many country code bots are just spoofing their source country.

Welcome to the never ending nightmare of 50% of non-human traffic.
 
You get 4 free country code blocks from cloudflare.

FOUR? I have now blocked 48 countries and blacklisted over 205 IPs. The IP Threat Monitor add-on sniffs out bots spoofing their source country. It would have been simpler to have a list of allowed countries but I'm not complaining.

1786930103989.webp
The free API key from ProxyCheck.io is good for 1000 hits per day which for my tiny 3-month old forum should be plenty? Same with the MaxMind API key that does geolocation.

I looked at Cloudflare. It isn't even a little bit intuitive or user (noob) friendly but thanks for the suggestion.

I've also got about 200 or so entries in my robots.txt file. (sample attached) I do not care about SEO at all.
 

Attachments

I looked at XF Bot Guard and considered it but with 52 pages of spread out information, I was overwhelmed. so I went with IP Threat Monitor in spite of its price tag because it does block by country.
These two do different things and accompany each other pretty well.

It's like playing whackamole but so far we've blacklisted 120 IPs.
Manually blocking IPs does not make to much sense typically.
The IP Threat Monitor add-on sniffs out bots spoofing their source country.
No, it doesn't.
I've also got about 200 or so entries in my robots.txt file.
The bots you are interested in ignore robots.txt anyway.

In the end it does not make any sense to start yet another thread with the same topic from scratch that has been excessively discussed already in the "crazy amount of guests" thread. It is a complex topic and it seems you start with the same wrong assumptions as many or most others. You can't successfully fight the problem w/o understanding it, there are no shortcuts and understanding needs knowledge and knowledge needs reading and gaining some technical basic understanding.
The documentation of bot guard is nothing that should put you off but rather attract you. Apart from if you believe in snake oil and miracles of course.
 
Manually blocking IPs does not make to much sense typically.

Who said anything about blocking IPs manually? IP Threat Monitor handles all of that and as of this morning after working for about 24 hours, shows 526 blacklisted and permanently blocked IP addresses. I din do nuffin.

No, it doesn't.
Are you sure? Have you purchased, installed and tested this add-on yourself? If access is detected as coming from a VPN/Proxy originating from a blocked country, it gets blacklisted. This detection is handled through proxycheck.io Try hitting my site using a VPN appearing to come from a blocked country and see what happens. Use a VPN coming from a not blocked country gets allowed through at least according to my testing. You can also block AI bots by ASNs.

I had 2 guests on my forum this morning. Both from the U.S. There were 100 to 240 before from everywhere.

In the end it does not make any sense to start yet another thread with the same topic from scratch that has been excessively discussed already in the "crazy amount of guests" thread. It is a complex topic and it seems you start with the same wrong assumptions as many or most others. You can't successfully fight the problem w/o understanding it, there are no shortcuts and understanding needs knowledge and knowledge needs reading and gaining some technical basic understanding.
The documentation of bot guard is nothing that should put you off but rather attract you. Apart from if you believe in snake oil and miracles of course.
I am sorry you are bothered I started a new thread rather than trying to catch up with 100's of pages in the other threads full of conflicting opinions and strategies. FWIW, my post provided a solution that appears so far to be doing exactly what I wanted, even without researching deep technical minutia to fully understand the problem which seems to counter your own assumptions.

Should my choice of solutions prove to be inadequate down the road, I will do my research into alternatives but if it does prove to be viable, I'll spend the time saved wading through pages and pages of information I really didn't need to know doing better things.
 
The IP Threat Monitor add-on sniffs out bots spoofing their source country.

No, it doesn't.

Are you sure?
Yes I am. Ip Thread monitor was designed as a flood protection initially and apart from that it can block countries, ASNs and proxies. The latter is based on the judgment of proxy check.io.
Have you purchased, installed and tested this add-on yourself?
I have and some features within IP Threat Monitor were developed on my request. Which you would btw. know if you had at least read the thread of the add on that you are using. I've been running it since the beginning of the year and currently my blacklist looks like that:

Bildschirmfoto 2026-08-17 um 19.58.45.webp
Which does not make much sense to be honest (I mainly keep the records for a strange amusement as long as they don't kill the performance) and does not say anything about how good it performs.
If access is detected as coming from a VPN/Proxy originating from a blocked country, it gets blacklisted. This detection is handled through proxycheck.io Try hitting my site using a VPN appearing to come from a blocked country and see what happens. Use a VPN coming from a not blocked country gets allowed through at least according to my testing. You can also block AI bots by ASNs.
As you lack the understanding what this add on does and how it works you also lack the understanding where it's limitations are. In this case they are within the detection of resident proxies by proxy check which leaves a lot to be desired. You feel protected where you are not and it is obvious that the strategy you choose is not well suited to the purpose you have in mind.

I am sorry you are bothered I started a new thread rather than trying to catch up with 100's of pages in the other threads full of conflicting opinions and strategies.
so you have a problem that you want to solve but are not willing to learn by yourself but rather expect others to serve you solutions, as you are too lazy to read yourself and believe, while all the others tinker and discuss for years, you found w/o and prior knowledge the perfect solution w/o learning by simply installing an add on this is a setup for failure. Obviously and not surprisingly.

FWIW, my post provided a solution that appears so far to be doing exactly what I wanted, even without researching deep technical minutia to fully understand the problem which seems to counter your own assumptions.
It works about in the same way as if you cover a warning light in your car and claim you'd have repaired it. There is no solution w/o understanding the problem first and the tools you use second. Not different to many other areas in life. What probably comes closest to that would be Cloudflare (despite leaving quite some open doors). But this is already too complicated in your opinion. A fool with a tool is still a fool and maybe you have to learn this the hard way.
 
Last edited:
A fool with a tool is still a fool
Wow! Not everyone aspires to your level of great technical expertise and understanding and insinuating that those who don't or don't live up to your standards are fools is pretty harsh, especially for non-technical people only a few months into all this. I don't have to understand the mechanics of internal combustion to drive a car.

If a band-aid solution appears to be working, do I really much care what is happening under the hood? As long as my users aren't asking me why 200 guests are on the forum and everything is working fine for them, that is good enough for me for now. If it doesn't work out, I'll look at other options.
 
The add-on does not block countries (which was the explicit request of the OP) and it does not solve the problem. It linders it to a certain degree but nothing more and not even the developer claims what you state what it would do.
I didn't say that it blocks countries. I just thought it was a good alternative to stop bots. Sorry I didn't specify that.
 
Try @Xon's sign up and abuse addon along with his standard library addon
It does it for you and it has the ability to help you add more countries to it
 
Wow! Not everyone aspires to your level of great technical expertise and understanding and insinuating that those who don't or don't live up to your standards are fools is pretty harsh, especially for non-technical people only a few months into all this. I don't have to understand the mechanics of internal combustion to drive a car.

If a band-aid solution appears to be working, do I really much care what is happening under the hood? As long as my users aren't asking me why 200 guests are on the forum and everything is working fine for them, that is good enough for me for now. If it doesn't work out, I'll look at other options.
I do think it's worth using Cloudflare - it's free. It's not that difficult once you know where to go. If I can do it you can :-) However I believe you'd have to set up DNS in cloudflare first.

The advantage is, all the blocking and filtering is done before anything ever gets to your forum or your server so it's not putting any strain on the server.

You get 5 free rules. You could have one rule for country blocking and still have four rules for other things. If you wanted you could have that rule say - block all countries except x y and z.

I got hit with 5000 or more bots after only regularly having 180 for a long time, and the Cloudflare rules helped to get this right down.

The problem you might have is, if the bots are using residential proxies (which mine are and seems common now), whichever IP's or ASN's you block, they will just move somewhere else.

Someone gave me the tip to download the raw data from the server, and run that by Claude AI. Who would then tell you if these are residential proxies or not, and what they are actually doing on your site. It can be helpful. Eg 99% of my bots are hitting "whats-new" so I have a cloudflare rule to challenge whats-new.

Basically whoever runs these bots, can have them appear from any country in the world by using ordinary peoples' home internet (hence residential proxy) - without people even knowing their internet is being used as a residential proxy. And they just keep switching IP's.

Anyway hope it's improved.
 
Last edited:
  • Like
Reactions: CTS
IP Threat Monitor now allows blocking by country OR allow by country and it does ASN blocking too This makes it much easier to setup than the 135 countries I had blocked manually. With an API key from Proxycheck.io, it detects, blocks and blacklists VPNs and proxies. 1000 checks per day free, 10,000 per day $4 a month.

In the last ten days with my online status timeout set to 60 minutes, I had two busy guest periods with 167 in an hour that quickly dropped off. On normal days we average 0 to 6 guests during any given hour. With the two brief swarms, 95% of the guests originated in the U.S. and weren't detected as using a VPN or proxy.

It isn't perfect but it's close enough. It blocks all VPN traffic unless you whitelist a particular service. If you whitelist providers like NordVPN, ProtonVPN and SurfShark etc., you may as well leave the door open. I had one legit member using a VPN that got blocked so he discontinued using it. My forum is new and small so this isn't a problem.

I am very happy with this add-on. The developer has listened to customer feedback and provides regular updates. I can't imagine being without it.
 
With the two brief swarms, 95% of the guests originated in the U.S. and weren't detected as using a VPN or proxy.
Proxycheck.io (and in the consequence IP Threat Monitor) is nor really good in autodetecting resident proxies. This is why the combination of IP Threat Monitor with Bot Guard is so useful: Bot Guard steps in where IP Threat monitor is somewhat blind while IP Threat Monitor offers the somewhat more rough filtering options based on country or ASN which Bot Guard does not offer and helps to keep the load down in Bot Guard.

What is quite helpful is to have a look at the proxycheck.io dashboard regularly regarding what has been blocked. You will discover that only few are IPs from dialup/DSL/Cable (so the typical annoying resident proxies) while most are IPs from servers and data centers. You will very quickly discover that many of them come from the same set of ASNs with loads of different IPs from various countries. It can be very helpful to identify these ASNs and block them directly in IP Threat Monitor as no normal genuine traffic is coming from those and blocking the whole ASN will also block IPs that proxycheck might not discover as bad.
 
The problem with some of them is, they are using headless browsers so they can solve challenges in both Bot Guard and Cloudflare and get through anyway, so I guess if you can block some that's better, but if they are residential proxies, as soon as you block some they will just reappear from another country. It's known as whack-a-mole.

I've spent over two weeks on it and they are still scraping my site (and I don't mean the bots that declare themselves as bots), albeit the numbers are less now.
 
but if they are residential proxies, as soon as you block some they will just reappear from another country. It's known as whack-a-mole.
It is not as simple as that. Clearly, it is easy to get rid of quite a lot of the annoying bots by blocking nasty countries completely if you do not have relevant genuine traffic from there and blocking nasty ASNs completely. This leaves you with a hand full of countries that you don't want to block and, within these countries, loads of ASNs and IP ranges. The proxycheck dashboard helps to identify nasty ASNs within these countries that are server ranges and can safely be blocked. Which then leaves you with the "true" residential proxies that hide within dialup ip ranges on ordinary client devices that you cannot/ want not to block flat out.

It is important to be aware that "residential proxy" describes a location in the first hand (and a routing/dispatching setup behind it), not a browser or such. While some providers of those proxies seem to offer more or less sophisticated custom clients others seem just to offer the infrastructure. And scrapers can and will use a range of different technologies and setups for scraping independent from the route they are taking IP-wise. The stupid ones are just scripts that can easily be detected and blocked through fingerprinting (by either cloud flare or bot guard) and they are not capable of solving captchas. Those who use a genuine real browser via things like selenium are not trivial to identify but those don't scale very well, take a lot of resources in comparison and need constant maintenance. So the real issue are the ones that use a more intelligent scripted approach, hide within client dialup IP ranges, escape fingerprinting by successfully pretending to be a genuine user / browser and are capable of solving captchas. Basically all sellers of residential proxies claim they would have this on offer - how many really do is unclear.

So in the end with a growing amount of bot requests you are doomed to use kind of a probabilistic approach to decide if it is a human or a bot and depending from where and how you place your bets you will either block a certain amounts of humans unwillingly or let pass a certain amount of more sophisticated bots unwillingly. This is the current state of technology and the only way out would be to lock your forum content that only logged in users are able to see it - which in most cases is not desirable, at least not in this radical fashion.

This is why I advocate for a combined approach: The more sophisticated scraping approaches are not exclusive to proxies on client networks but also used from datacenter ranges and detection via fingerprinting will fail there as often. So blocking hard by country/ASN/IP-Range what can easily be blocked w/o or with minimal collateral damage helps a lot. Using fingerprinting (with i.e. Bot Guard), captchas and other things like the services of proxycheck helps against a relevant part of the others. Limiting options, search or what content can be viewed for guests helps to hedge the damage the rest can do in terms of performance or scraping valuable content (with the trade off that it will influence your Google ranking when done harshly but effectively).

However: I have gone a very harsh approach regarding blocking and limiting guest visibility and have paid a price in terms of Google ranking. But: The amount of bots on my forum has come down to a minimum and the damage they can do is minimal as well. W/o using Cloudflare or sophisticated technology. Cloudflare and their captchas are the industry standard and this means: It is worth for bots to focus on dealing with Cloudflare and to circumvent their captchas and other protection mechanisms. Basically a rat race: Sometimes Cloudflare is in front, sometimes the bots are. Using something different than Cloudflare might therefore bring an advantage.

And there's another aspect: The bot armies have to have a central point that sets the directions. From somewhere they have to get the directions what they shall scrape. I would assume that gathering this information happens well before a bot wave starts and that it typically does not happen through residential proxies but rather from some server ranges. I don't know how they do it (i.e. by collecting sitemaps, rss-feeds or such) but I clearly see, that after some time of massive hard blocking of loads of evil ASNs the bots seem somehow to have lost interest in my forum. Either the upfront collection of what to scrape has been cut or they have decided that the very limited content they can reach at all is not interesting enough for all the trouble.

Over the last months there were only a small couple of peaks (would not even call them waves) aside of the usual noise. This is my 90 day proxycheck graph, leaving out those that have already been blocked by country blocks or other simple blocks via regex in .htaccess):

Bildschirm­foto 2026-09-19 um 13.20.16.webp
Based on those spikes of the green curve you can also clearly see, that proxycheck is not really good when it comes to identifying resident proxies from dialup client ip-addresses.
 
I was blocking ASN's for a while, but that effectively led to blocking some entire countries anyway - the smaller ones that only have one or two main communications ASN's. The difference between blocking a country by ASN as opposed to a country block though, is VPN's can be used with a country block but VPN's can't be used with an entire country ASN block. Which has it's pros and cons. If no VPN's then residential proxies can't use them from that country. On the other hand it also means genuine people can't access a site using a VPN if they wanted to.

It's also important to know what the ASN is - I accidentally blocked one that turned out to be Starlink globally - meaning any real people using Starlink anywhere in the world are blocked. Only found out because it blocked me as well - because I use Starlink.

Also best not to block Singapore and just challenge it as a lot of big companies based there.
 
Back
Top Bottom