Blocking bots without blocking customers
Blocking a country or an IP range stops a bot and stops a sale you will never hear about. The five rules we apply instead, and what we refuse to do.
The request we get most often when a store is under junk traffic is to block the country it appears to come from. We do not, on any store, and here is why. Blocking a country, a provider or an IP range is the fastest way to stop a bot and the fastest way to stop a sale, and you will never hear about the sale. The bot, meanwhile, moves to the next range in minutes.
The rules we work to
- Search engine crawlers always get through. Verified by reverse lookup against the published ranges, not by the user agent string, which anyone can type. A store that blocks a real crawler for a week loses rankings that take months to rebuild.
- Potential customers always get through. No country blocks, no blanket provider blocks, no “refuse anything from a datacentre”. Plenty of real people browse through VPNs, corporate proxies and mobile carriers whose addresses look like datacentres.
- Challenge before you block. A challenge page costs a human two seconds and stops most automated traffic. An outright block costs a human the sale. Blocks are for traffic that is unambiguously abusive, and even then by behaviour, not by origin.
- Block the pattern, not the source. A bot hammering filter combinations on category pages is identified by the request shape: the parameters, the rate, the absence of any static asset loads. Refuse that shape at the web server, for everyone, and the bot is stopped without a list of addresses to maintain.
- Log first, block second. Run the proposed rule in logging mode for a day. Count what it would have blocked and read a sample. If a real customer’s session is in it, the rule is wrong.
What this looks like in practice
At the web server: rate limits per path on the expensive pages, refusals for request shapes no browser produces, and a short list of crawlers known to ignore robots and bring nothing. At the edge: a managed challenge on traffic that scores as automated, tuned so it fires rarely on real sessions. In the application: nothing, because by the time a request reaches the application it has already cost the resources you were trying to save.
What we refuse to do
No geographic blocks on a store that sells anywhere. No blocks on whole cloud providers. No rules written on one angry afternoon and left in place for years. Every rule carries a comment with the date and the reason, and every rule is reviewed when the store’s traffic changes. A rule nobody remembers the reason for gets removed, not kept out of fear.
Two earlier pieces describe specific cases: filter floods on layered navigation and AI crawlers on a publisher’s site. The approach is the same in both, and it is standard on every store we host.
Got a similar problem? Talk to us.
Start a project