Block Referrer Spam at the Source

By Steve / a couple of years ago
how to block referrer spam at the source

I’ve been working on other projects and it has been a while since I added new content to Crash Cloud. I was quite impressed as I blew the dust off my Google Analytics account to see if anyone was still visiting this site; traffic had tripled and I hadn’t lifted a single finger. Nice!

However, after peeling back the layers of the onion, a different reality reared its ugly little head… referrer spam!

If you are not familiar with the term, referrer spam (aka referrer bombing) is a blackhat traffic generation technique used by some of the shadiest companies to drive traffic to website sales pages. These webmaster uses bots to crawl thousands of websites and falsely impersonate a real visitor.

When webmasters view their website’s analytics and sees dozens of visits from a referrer in Russia, curiosity naturally drives them to visit the site and see what it is all about. They are then immediately redirected to another website which is usually promoting a product or service.

Spam referrals also make a mess of Google Analytics data because these referrals have high bounce rates – in my case the data was skewed so badly that I couldn’t make sense of anything. I knew it had to be stopped.

I won’t go too heavy into details as other sites like Raven’s blog have covered the topic of blocking referrer spam in much greater detail. After trying a few different techniques, I found the most effective way to block referrer spam is to update the .htaccess file and block these spammers cold in their tracks.

How to Block Referrer Spam with your .HTACCESS File

To block referrer spam, simply access the root folder of your website via the cPanel or an FTP program like FileZilla. Edit the “.htaccess” file and add the following code to the bottom:

# BEGIN SITE REFERRER BANNING
RewriteCond %{HTTP_REFERER} semalt.com [NC,OR]
RewriteCond %{HTTP_REFERER} buttons-for-website.com [NC,OR]
RewriteCond %{HTTP_REFERER} trafficmonetize.org [NC,OR]
RewriteCond %{HTTP_REFERER} 4webmasters.org [NC,OR]
RewriteCond %{HTTP_REFERER} 100dollars-seo.com [NC,OR]
RewriteCond %{HTTP_REFERER} best-seo-offer.com [NC,OR]
RewriteCond %{HTTP_REFERER} webmonetizer.net [NC,OR]
RewriteCond %{HTTP_REFERER} seoanalyses.com [NC]
RewriteRule .* - [F]
# END SITE REFERRER BANNING

That’s it! As more spammy website referrers show up in your website logs and analytics, add another line

RewriteCond %{HTTP_REFERER} anotherspamwebsite.com [NC,OR]

and kiss the spam good-bye.

If this article helped you block spam referrals to your website, don’t forget to spread the word below.