I want to block AhrefsBot

In the security rules section, allow all known bots option is active.

however, this option also allows AhrefsBot.

I also created a different rule.

semrush, ahrefs etc… to block other bots.

this rule I created works fine.

blocking all requests from semrush.

but it cannot block requests from AhrefsBot.

How should I go about it?

You mean a Firewall Rule?

Here’s my first rule. And then your later rule will work.

@sdayman thanks…

I guess I got misunderstood while translating.

I want to repeat the problem:

2 different security rules are active.

1st rule - allow all known bots.
2nd rule - semrush, ahrefs etc. I want to block bots.

I guess in rule 1 the system allows ahrefs bots.

but I want to block ahrefs bots.

what should i do for this?

I am waiting for your support…

Hi aga2442, you first rule needs to be …
Known Bots | equals | On
And
User Agent | does not contain | AhrefsBot

Please refer to the example that sdayman provided.

1 Like

@aga2442 - your rule 2 should be on top of rule 1. Please note that for Allow action, matching requests are exempt from challenge and block actions triggered by other Firewall Rules content. For more details on the actions and the order of precedence, please check https://developers.cloudflare.com/firewall/cf-firewall-rules/actions.

Also, the example provided by @sdayman should work.

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.