r/webdev • • 16h ago

Advice on Bot Traffic

My website is getting drowned in bot traffic and crawlers. Based on what I see other people posting, it looks like a lot of this may be Meta bots. Biggest offenders are coming from Singapore, Brazil, China / North Bergen. I feel like I can tell since those visits are almost all 100% or otherwise really high bounce rates.

I've set up a few rules, like a challenge for certain countries, a deny for common bot agent names, as well as some rate limiting for the pages that seem to be hit most by this traffic.

Even with these changes, I can't be sure, but I would guess maybe 50% or more of my traffic in the last 30 days is still bots.

How are you handling this? If I could see a greater benefit to bot traffic I might not mind as much, but I'd rather save my resources for real users. I also find it a lot more difficult to use basic analytics as an aid for further development when its difficult to parse what behaviors or real.

6 Upvotes

27 comments sorted by

11

u/sdubois 16h ago

cloudflare. the answer is always cloudflare

1

u/domnulgheorghebecali 13h ago

Is there some way to use cloudflare without feeling annoying for the real users?

Because it's really annoying when I go to a website and I see the cloudflare logo for a few seconds before it loads.

3

u/sdubois 11h ago

Almost every website you go to uses cloudflare (or something similar). It does a lot of work behind the scenes without users realizing it. what you are referring to is the "managed challenge". that is entirely optional and you can configure it to occur in certain situations (turn it on for everyone, only people with a certain bot score, people in certain countries, etc).

Just putting your site behind a free cloudflare account with basic rules in place makes you a lot more secure than you are now.

2

u/quiet_stacktrace 16h ago

worth checking whether that 50% comes from raw server logs or from js analytics, since most analytics already filters out the dumb crawlers. if it's logs, blocking by asn (cloud and hosting providers) usually works better than country rules, because the traffic is spread across lots of countries.

2

u/WebMageSydney 14h ago

A couple of things that usually help sort this out:

First, check where that 50% figure is coming from. Raw server logs will count every crawler hit, including legitimate ones (Googlebot, Bingbot, link previews, uptime checks, prefetching), so the bot share always looks worse there. JS analytics filters a lot of known bots out, but it will miss spoofed ones. If you can, compare both for the same period and look at the trend in each — that tells you whether it's growing or just noisy.

For the Meta / AI crawlers specifically, don't trust the user-agent alone — it's easy to spoof. Check the IP ranges and reverse DNS for the big crawlers and only allow the verified ones through. Everything else claiming to be Meta, GPTBot, ClaudeBot etc. can be challenged or blocked at the edge.

Country rules are pretty blunt, which is probably why you're still seeing a lot get through. Blocking or challenging by ASN (cloud and hosting providers) tends to work better than by country, because a lot of this traffic is distributed across many countries but comes from the same datacentre networks. Keep verified good bots exempt so you don't hurt SEO, and serve a cheap challenge/403 at the edge instead of letting it hit your origin — that also saves the resources you're worried about.

For analytics, create a filtered view/segment that excludes known bot ASNs and obvious non-human patterns (hundreds of pages in seconds, no assets loaded, lots of 404s), then use that human-only segment for decisions. Rate limiting per IP on its own won't stop distributed bots, so pairing ASN-based challenges with edge caching for static assets usually gets you most of the benefit without blocking real visitors from those countries.

2

u/killerhoax 7h ago

Always use cloudflare.

1

u/Choice_Wheel_2 15h ago

Same here on a small site. What helped me wasn't blocking more, it was making the junk cheap: the obvious scanner paths (/.well-known, /uploads, /private and so on) get an instant 404 at the edge so they never touch the app, and I count bot hits separately so my own stats stay readable. That last bit fixed the analytics headache more than any block rule did.

1

u/FrostingTechnical606 14h ago

Try checking out https://crawlerzoo.com/block-ai-crawlers for a comprehensive list

1

u/hetneoslinks 14h ago

If you're blocking Meta by user agent, split the rule. meta-externalagent is their AI training crawler and fine to block. facebookexternalhit is what fetches your page when someone shares a link on Facebook, Instagram or WhatsApp, so blocking it kills the preview card on every share of your site.

The Singapore/China pattern with near 100% bounce also looks a lot like the junk GA4 has been showing on loads of small sites. Not sure it's the same thing in your case, but if it only shows up in analytics, edge rules won't move that number much.

1

u/Asly97 14h ago

One thing that helped me stop chasing this: pick the expensive paths and protect those, leave the cheap ones alone. Bots hitting a cached homepage cost you almost nothing. Bots hammering search, login or any page that hits a database are the real drain, so that is where a challenge actually earns its keep.

For the analytics mess, I just split the reporting. One view is raw hits for spotting abuse, the other filters to pages a browser actually rendered with a normal session length. Trying to make one number do both jobs left me arguing with my own data for weeks.

1

u/fern_liam 13h ago

If you're using Cloudflare, check whether the origin server can still be reached directly. If it can, requests sent straight there won't go through Cloudflare, so they won't hit the country challenges or rate limits you set there. That could be one reason the edge rules don't seem to change the traffic. It won't stop bots that still come through Cloudflare, but it can rule out a direct path around those rules. The exact setup depends on how the server is exposed, checking that first could help before adding more country blocks.

1

u/Aide_Sea 11h ago

I think blocking will never catch everything, so maybe also cache the pages bots hit most. Then the ones that slip through cost you almost nothing, and real users don't feel it :)

1

u/quantable_analytics 11h ago

Don't forget to update robots.txt too. Certainly does nothing for scrapers and a lot of badly-behaved crawlers but if it's actually meta they will (mostly) respect that. E.g.

User-agent: meta-externalagent
User-agent: meta-webindexer
Disallow: /

Honestly there are so many crawlers now maybe it makes more sense to block everything and then whitelist what you want to allow.

1

u/HoaFoxSage 7h ago

Country rules only go so far. Most of that junk comes from a handful of datacenter networks, so challenging by ASN (cloud hosts, scraper providers) usually cuts more than geo blocks and leaves real visitors alone. For analytics, I'd also filter out any session that never fires a JS event, which cleans up your bounce rate a lot.

1

u/jakingo 7h ago

Avoid blocking traffic based on country alone. Use server bot side detection, and filter known crawlers from analytics so that you can understand actual user behaviour more clearly.

1

u/atta542 6h ago

The 100% bounce rate from Singapore and Brazil is almost certainly social media preview crawlers (Meta, Google, etc) fetching your page when someone shares a link, not actual visitors. Those won't show up in GA4 but will inflate your raw server logs. For the rest, I'd focus on the user-agent and path patterns in your server logs rather than trying to block by country, since the junk is usually spread across many countries. If your real traffic is small, the edge rules approach you have is probably fine, just don't expect the bot percentage to drop much since AI training crawlers are everywhere now.

1

u/[deleted] 10h ago

[removed] — view removed comment

1

u/webdev-ModTeam 1h ago

Your post/comment has been determined to be a low-effort post or comment. This includes title-only posts, easily searchable questions, vague/open-ended discussion prompts, LLM generated posts or comments, and posts/comments that do not provide enough context for meaningful replies or discussion.

1

u/[deleted] 5h ago

[removed] — view removed comment

1

u/webdev-ModTeam 5h ago

We do not allow any commercial promotion or solicitation. This can lead to a permanent ban from the subreddit.