The site ahrefs.com can purportedly tell any site owner, for prices starting from 99$ / month, who links to them from where, and also provide site owners with other seemingly significant and meaningful data about visitor activity.
The problem is, they use software bots to crawl sites, and THOSE BOTS CLICK ON LINKS in your site, if you have outgoing links, probably to verify if the outgoing links have real destinations or are just linkbaits. For a regular site, WITHOUT AFFILIATE connections, this probably won’t hurt anyone, but in the case of affiliate sites, regardless of affiliate programs, it’s a disaster.

I run a small, private URL shortener and tracker for several banner rotators and affiliate blogs, and guess what, I’ve discovered today, that ahref.com bots have produced a waste of around 2.160.000 banner displays, and 34.000 clicks to affiliate banners and links, in just a short amount of time, from march 2016 to august 2016. That’s a lot of clicks, as any affiliate will notice immediately, and if you care at all about hosting costs, and not wasting bandwidth, you will want to block any and all activity coming from such bots, because obviously, since they are just bots, they will never produce any affiliate income for you.
It could be that they are using a lot more IP blocks then I’ve discovered, but even blocking access to your site from these questionable ahrefs blocks, could result in less bandwidth being used, and FASTER loading of your affiliate content to RELEVANT parties, i.e. real visitors and potential buyers of your affiliate stuff.
And your hosting costs can be kept intelligently small, and your affiliate statistics a lot cleaner without these useless bots accessing your online estate.
The first IP range they are using is: 164.132.161.2 … to 164.132.161.97, and the other is, 51.255.65.2 to 51.255.65.97
To block these entire IP blocks from accessing your site, enter the following rules into your .htaccess file on your server:
RewriteEngine On RewriteCond %{REMOTE_ADDR} ^164\.132\.161\.([2-9]|[1-8][0-9]|9[0-7])$ [OR] RewriteCond %{REMOTE_ADDR} ^51\.255\.65\.([2-9]|[1-8][0-9]|9[0-7])$ RewriteRule ^.*$ - [F]
Obviously, if you have other blocking rules, you will have to modify it slightly, maybe add another [OR] after the second RewriteCond line, or in some other way, depending on what your current blocklist contains.
And to make sure that if the user agent is that of an ahrefs bot, it is denied access to your site, add these lines, too
SetEnvIfNoCase User-Agent .*ahrefsbot.* bad_bot <Limit GET POST HEAD> Order Allow,Deny Allow from all Deny from env=bad_bot </Limit>
And you’re free to add any other user agent as “bad bot” to your user agent-based block rule above.
Share this with your friends, especially if you are part of an affiliate network. They’ll thank you for saving their bandwidth, hosting costs, and making their statistics more readable.
Jessie Eastland
March 30, 2023 at 19:24AhrefsBot sucked 1.8 gigs of bandwidth in one visit this month and shut me down until I was able to pay for more. 3 days my site was down, and I didn’t even know it. They should be hung by their balls.
Wookie Chewbacca
March 31, 2023 at 14:25I wouldn’t bet on them not liking it 😉
Just kidding
Malin
October 1, 2017 at 09:00There’s much more bots that waste bandwidth like Seznam or Semrush. I tend to find their IP ranges using bgp.he.net and block the CIDR’s used at firewall level to spare Apache resources as well.
Wookie Chewbacca
March 31, 2023 at 14:26You’re right, we do have to protect those resources.