WHAT IS AHREFSBOT AND HOW TO BLOCK IT?

Method 1: Block Ahrefsbot With robots.txt
Ahrefs says that Ahrefsbot follows robots.txt rules. You can block Ahrefsbot by adding new rules to your robots.txt file.

You have two options here:

Change the frequency Ahrefsbot can visit your site
Completely block Ahrefsbot from visiting your site
To change the frequency of Ahrefsbot visiting your site, add the following code to your robots.txt file:

User-agent: AhrefsBot
Crawl-Delay: 5

Crawl-Delay value is the time of the delay recorded in seconds. You will need to change this value to delay the number of seconds between each crawl from Ahrefsbot.

Want to block Ahrefsbot completely?

To do that you will need to add a disallow tag to your file. Simply copy and paste the code below:

User-agent: AhrefsBot
Disallow: /

That’s it! Ahrefsbot should obey the robots.txt rule you just set up.

Method 2: Block Ahrefsbot Using the .htaccess file
This is a very effective method for blocking Ahrefsbot and gives you more control.

Unlike method 1 where you rely on the fact that the Ahrefsbot will obey the rules you set – with method 2, you will be taking complete control at the server level.

You will be adding the range of IP addresses that the Ahrefsbot uses and blocking it based on those IP addresses.

Here is a small example of the code you could add to your .htaccess file to block IP addresses:

Order Allow,Deny
Deny from 51.222.152.133
Deny from 54.36.148.1
Deny from 195.154.122
Allow from all

You want to make sure you block all of the current Ahrefs IP addresses that are listed here. That means you will need to edit the code above to make sure it blocks the current IP’s used by Ahrefs.

Follow this tutorial if you need help with your .htaccess file.

Leave a Comment