Stop, Block, & Ban Referrer Spam

By July 6, 2015SEO
STRYDE | Stop, Block, & Ban Referrer Spam 2

Over the last few months, we’ve noticed referral traffic spike to many of our sites hosted on WordPress. Awesome right?

Well, not after looking at good old Google Analytics:

referrer spam view in google analytics

What is Referrer Spam?

Referrer spam is a feebly devised tactic to increase traffic to a certain domain. The aim, according to Raven Tools, is to make that domain appear in your analytics (as shown above) so you’ll visit the site. In the screenshot above, you can see how an individual could easily click one of those sites.

Why is Referrer Spam a Problem?

First off, referrer spam creates a problem when it comes to validity of data. These ‘visitors’ alter key statistics you need to analyze to improve your site. The total volume of sessions and visitors is obviously misrepresented. But not only that, but demographic, geographic, and device data is impacted.

How Do I Block Referrer Spam?

There are a multitude of ways you can tackle the beast that is referrer spam. Let’s take a look from around the web at what experts have suggested:

Option 1: Google Analytics Filters

Tom Capper of Distilled outlines a great option that doesn’t involve access to the backend of the site, just access to the analytics. While it doesn’t stop the traffic that has already arrived, it does remove it from your view.

Georgi Georgiev of Analytics Toolkit also advocates for filters within analytics, and details a comprehensive approach to applying multiple retroactive filters.

Option 2: WordPress Plugins

In the WordPress Plugin Directory, there are a few options to aid in filtering incoming traffic. SpamReferrerBlock and the Semalt Referrer Blocker are two of the most prominent options.

Option 3: .htaccess File

Adding several lines of code to your .htaccess file will create a virtual barrier between your site and those spamsters. This option is typically regarded as the most invasive and it does require upkeep, but it’s the most effective option to eradicate referral spam.

We’ve provided a CSV below that includes the code we used to stop our referral spam across our sites. You can simply use the list or customize it to include only the referrer sites that are impacting your site:

Click the link to download the CSV: Referrer Spam Ban .htaccess file

You’ll also need to customize the line of code that precedes the list of spam sites:

RewriteCond %{HTTP_REFERER} !.*YOURSITEHERE\.com/.*$ [NC]

In terms of bringing out the “big guns,” adjusting your .htaccess file tops the list. But, that also means that it’s serious stuff for you site. Ensure that your file is immaculate! Even one character out of place could take down your whole site.

For example, omitting that line of code with your site name as detailed above, will cause sporadic 403 errors across all pages of your site. Bottom line, make sure you feel comfortable with code before implementing this option!

Option 4: Any Combination of the Above Methods

If you’re especially concerned about referrer spam, you can combine any or all of the methods above to create layers of protection.

Does a Long-Term Fix Exist?

Unfortunately, the answer is no. While Google is aware of the referrer spam problem, no long-term solution exists beyond an overhaul of how Google Analytics tracks visitors. So, we are left to work with what we have at our disposal.

Don’t let referrer spam make a mess of your analytics. Stop, block, and ban it before it even hits your site. What’s your favorite method to stop spam traffic? Share it with us in the comments!

About Laurel Teuscher

Laurel is a member of the executive team at Stryde. She found her passion in digital marketing and loves to talk about it all day. When she decides that she's had enough of work, she's usually working through her stack of books, preferably next to a pool or beach (in her native California) or traveling to far off places and posting her adventures (and the food she finds) to her Instagram.

2 Comments

Leave a Reply