Referral Spam

Block / Referral Spam in Google Analytics

How irritating is this problem? (4 votes, average: 5.00)

This page was created to explain what / Referral Spam in Google Analytics is and help users block it.

If you are a website owner and your site traffic statistics have been looking odd lately and if there seem to have recently been a lot of visits from one or two other sites with little (or most likely no) session time and pretty much hundred percent bounce rate, than you have likely gotten targeted by a referral spammer. This type of spam is targeted at different websites and its purpose is to generate traffic for the spammer’s own site. The way the spammers are able to achieve that is as follows:

They use spam bots and crawlers to make visits to your site (hence the no session time) that are supposed to draw your attention to whoever is visiting you. In your site’s GA stats, you will see the name of the spammer’s site as the web location from which you have been getting all those empty visits. Likely, your curiosity will take over and you will decide to pay the said site a visit, thus giving it a view and, in turn, boosting its own GA ranking. Of course, a single visit will not change much for the spammer’s site but keep in mind that this type of referral spam schemes are massive and they target thousands upon thousands of sites all over the Internet and the end result is a significant boost to the stats of the spammer’s own site.

It could be annoying and also problematic if you have been targeted by this type of referral spam. Below, however, we will show you how to handle one of the most recent forms of referral spam known as This is a representative of the so-called ghost spam and dealing with it is not as simple as filling its name in Google’s Exclusion list. In fact, this is something you really shouldn’t do and we will explain why below the following guide that we advise you to check out.

Remove referral spam

STEP 1: In your Analytics account go to Admin —> All Filters.

pic 1(1)

STEP 2: Next, click New Filter and add in the Filter Name value.

STEP 3. Select the Custom Filter Type.  In the Filter Field —> Campaign Source. In the Filter Pattern text box, add and click the Save button at the bottom of the webpage.

Pic 2(1)

 Blocking referrer spam through .htaccess

If you know how to access your .htaccess file, you just need to input the following code in there:

RewriteCond %{HTTP_REFERER} [NC,OR]
RewriteCond %{HTTP_REFERER}
RewriteRule .* - [F]

If you don’t know how to access it, do the following:

Login to your cPanel account —> File Manager —> click the check-box “Document Root for—> your website. A side note: click on “Show hidden Files” and then Go. Find the .htacess file, right click it and choose Code Edit. Input the code I gave you and Save Changes. 

Did we help you? A thank you in the comments goes a long way to warm our hearts!

Ghost spam

As we said, is no regular referral spam that uses bots or crawlers as those are no longer effective due to Google’s Exclusion list. Instead of spamming you with bots, actually directly alters your site’s statistics in GA and makes you think you have been getting visits from it, when, in reality, no actual visits have come to your site from the spammer’s one. Therefore, adding the spammer’s website to Google’s exclusion list won’t work – it will actually make things worse than they currently are. Google will check the site in question and will determine that it doesn’t actually distribute spam visits (remember – no visits actually take place with ghost spam). This will lead to Google marking the site as legit and you will no longer be able to do anything to stop it from messing with your GA stats. So, instead of doing that, we advise you to try out our guide and maybe choose a better host provider in order to get better site security in the future.

Leave a Comment