Whack a rodent bot: How to setup cloudflare to avoid bot spam traffic
Three years of harassment, high volume spamming of this blog with spurious traffic!
I wrote about it here.
Now the bot traffic is gone. 👍!
And it cost me just a few hours to clamp this spamming down!
Below are the bot blocking steps I took. First a quick summary:
- This blog is hosted by Google's blogger.com. Skip / change below blogger instructions if you have a different blog hosting provider.
- The approach needed a new domain name, as I was previously using blogger's domain name space (https://equational.blogger.com). Therefore this solution is not only filtering traffic, it also "moving" my blog from its blogger address to https://blog.coadjoint.com as already many years ago I realized that I was outgrowing a pure equational approach to software.
- Hindsight is gold, one thought might be, and without malice, that the "co" was missing in the adjoint approach.
- Cloudflare's service immediately blocked the bot. Therefore to fully enjoy participating in the whack the bot rodent game, and even though not strictly necessary, I too added manual blocking rules for the incriminating bot activity.
My blogger bot blocking migration
- I have a domain D (for me: coadjoint.com) name hosted by R. My new blog address with be blog.D (my target blog path is: blog.coadjoint.com). You can choose differently than "blog".
- Add D to cloudflare.
- Add D under the Domains section of Cloudflare.
- Choose your plan.
- Let Cloudflare infer your domain's details.
- Switch off all Cloudflare's bot access exceptions (e.g. "Allow bots to scan your site..." -> off).
- Switch on "Bot Fight Mode"
- Note: no extended path "blog.adjoint.com" in the above!
- Redirect your domain's traffic to Cloudflare
- Copy Cloudflare's nameservers (e.g. my.ns.cloudflare.com and bob.ns.cloudflare.com)
- Replace R's old nameservers with the ones from Cloudflare.
- Try to redirect blogger to use a custom domain
- In blog's blogger setup set "Custom domain" to be blog.D (blog.coadjoint.com).
- You get an error, copy the two CNAME fields from the blogger error boxes.
- In Cloudflare setup both CNAMEs copied from above.
- Under domain D, DNS > Record
- Click Add.
- Change type to CNAME
- Past name and target
- Make sure to have 'DNS Only' set (no proxy).
- Do it twice as you have two CNAMEs to add.
- Wait, wait, then again redirect blogger to use a custom domain
- In blog's blogger setup set "Custom domain" to be blog.D (blog.coadjoint.com).
- At some point this succeeds, as routing information will have be updated.
- Ensure that HTTPS availability is switched on.
- Browse blog.D (should work).
- Now set blogger's setting to have HTTPS redirect activated.
- Wait a bit.
- Check that you old blog (equational.blogger.com) is redirected to blog.D .
- Go back to Cloudflare and change CNAME records to Proxy (we had set them to DNS only before).
- Change blog name if needed. Write a blog post about the changes.
- Change existing blog links to reflect the new domain (at least in the widget part of your blog)..
- For extra enjoyment add explicit bot blocking rules.
- Look at Cloudflare's security analysis under "domain" D / Security / Analytics
- Select an bot event (in the Events Sampled Log)
- Find the event's ASN (AS number)
- Add a Security rules:
- "AS Num" "is in" "copied ASN" And "Known Bots" equals "unselected".
- (later extend that ASN entry list).
- Give the rule a good name (e.g. "Block Bots by ASN")
- The raw rule expression should look like this:: (ip.src.asnum in {...} and not cf.client.bot)
FYI
- Spam traffic hurts a blog's indexability. I again want to thank the heads up from my former colleague on this subject! 🙏
- Harassment: Any unwanted and repeated behavior, action, or speech that makes a person feel distressed, humiliated, or threatened. It creates an unsafe, hostile, or offensive place for an individual or group.
All original content copyright James Litsios, 2026.
