How to Block ALL Bots except Google

Please tell me How to Block ALL Bots except Google.

You can use cf.client.bot in a firewall rule, however that would only block the crawlers listed at https://developers.cloudflare.com/firewall/known-issues-and-faq/#how-does-firewall-rules-handle-traffic-from-known-bots and you would need to exclude Google manually.

Apart from that it is pretty difficult to impossible to block β€œall” of them. It would require a lot of manual tweaking and even then you wouldnt have a guarantee.

You can check out https://medium.com/binary-passion/show-bad-mannered-bots-the-door-to-403-2fbb0cd34dc3 for starters.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.