When it comes to annoyances, referrer spam is right up there with hacking. Few things are more irritating than seeing a bunch of flakey URLs in your Google Analytics dashboard pretending they’re sending hits to your site.

Referrer spam is where fake websites use bots to pound your site with requests, which makes their URLs show up on your Google Analytics dashboard. Spammers hope you will click on those links and give their sham site traffic, or better yet, inadvertently link back which helps to bump their site’s search engine rankings

At best, referrer spam bots totally skew your Google Analytics results. So when you want to show your stats to a client, potential advertiser or sponsor, the numbers of unique visitors are exaggerated and your bounce rate is 100%. It looks terrible!

referrer spam source

Ghost spam is even dodgier since it doesn’t actually interact with your site, but it leaves a trail of fake data in its wake.

Worse, spam bots can make your site part of a botnet, where your site is more easily accessed across hundreds of IP addresses around the world.

At worst, spam bots inject malicious code into your site to make it part of that botnet, and to forward yet more spam and viruses.

It’s not a pretty picture.

Hopefully, you have anti-virus software on your computer, since that is often the way spam is forwarded.

There are several popular ways to damn that referrer spam, but unfortunately they don’t all work. I’ll show you those two first and then I’ll give you a tool that does indeed work to damn your referrer spam to hell.

.htaccess file

Some people recommend adding referrer spam URLs to the .htaccess file to presumably turn the bot back at the door. But you have to be careful. The .htaccess file, like wp-config, is sensitive enough to the workings of your site that one false character can shut it down.

Here’s a video tutorial that discusses comment spam and how to block it in an .htaccess file:

Security plugins, like All in One Security have places to paste the spammy URLs and will code them in for you.

AIOWPS referrer spam

The downside to this method is constantly adding new referrer spammers that come along. What a hassle! And, it doesn’t always work.

Google Analytics Filters

The other recommended way to block referrer spam is set up on Google Analytics itself. You are going to All Filters to Add Filter to View and fill out the necessary information for each and every spammy URL.

Here’s a video tutorial to show you how to simply hide referrel spam from your Google Analytics results.

Again, the downside is continually adding all the spammers that hit your site. This is even more work that the .htaccess file. And still the buggers slip through!


While researching this post, I stumbled upon the Loganix Ghost/Referral Spam Tool. I’ll admit to being skeptical when I read their site, but since the tool is free, I decided to give it a try.

Once confirmed, I clicked on a link that opened a browser window and had me choose a view to filter and create a segment.

These videos show how it works.

When I got to the GA dashboard I just needed to create a new segment to select the loganix filtered view. With both All Sessions and loganix.net selected you can see the difference between the spammed view and the clean view.

As for the downside of staying up to date with the newest spambots, that happens once per week when you receive the Loganix link to upload their updated filter.

So instead of copy/pasting URLs into the Google Analytics filter or your .htaccess file, you upload the tool to your Analytics dashboard once a week, select the view, and that’s it!

I’ve been watching a handful of sites on my Google Analytics dashboard and the Loganix tool definitely works. Better for some sites than others. The sites that have been hacked in the past still get spam, probably being part of a botnet.

The company does warn that the tool is 97% accurate, so there’s that. Give it a try!

Damn that referrer spam

Of course, nothing of these methods work retroactively, which makes doing something immediately more urgent.

It would be great if Google would make our lives easier by working their algorithmic magic to make all referrer spam go nowhere, but until that fine day this is what we have to work with.

How about you? How do you deal with referrer spam?