Referral Spam

How to Block Referral Spam in Google Analytics

The page was created to help you block the referral spam in Google Analytics.

If you are reading this article, it is likely because you have unusual activity on your website though the help of google analytics. This is caused by a visitor originating from the However, this visitor is not real. You are actually a victim of a practice called referral spam.

What is referral spam?

Referral spam is a black-hat practice that aims to attract visitors to certain webpages using illegal methods. Referral spam services are usually employed by quick cash grab websites, which seek to promote themselves as aggressively as possible. The method in which this is done is twofold:

  1. Webmasters who notice an increase in traffic from will often be curious enough to open the site to see what all of this is about. Usually then are then redirected to the site that gets promoted in this manner, therefore creating an actual link that will boost the site’s popularity in online searches.
  2. Another method is called backlinking – this is done by logging requests in you site’s access log with the help of a crawler bot. When your log is indexed by Google’s own crawl bots they will register these requests and create a backlink to the site.

Currently referral spam links to an empty page, but we expect that this to change very soon. It is possible that this was done as a means to illustrate the skills of the hacker that is behind the spam. In general, it is NEVER a good to open websites promoted by a referral spam such as After all, this is everything the hacker wants you to do.

Is referral spam dangerous?

Typically referral spam is not directly harmful to sites subjected by it. It has also been confirmed by Google that it has no effect on the site’s ranking in the search engine. However, the referral spam is still an unnatural and unwanted process and it will definitely mess with the accuracy of any statistics retrieved from Google Analytics. A quick action against the spammer is adviseable. Also, it is quite possible that certain attack sites may choose to reach a greater coverage by paying for the services of referral spam. This only stands to reinforce the principle that referral spam sites should never be opened, for any reason.

Also, please note that while may list 100% bounce rate on its visits, the spam never actually accesses your site. It manipulate your Google Analytics directly by feeding it misinformation. This is one of the main reason why the spam has no real effect on the ranking of your own website.

Forget about the referrer exclusion list

You may already know about the referrer exclusion list, but using it as a solution to the problem presented by is a terrible idea. For one thing it’s not what the exclusion list was created about – it was actually meant to assist site that offer clients the option to purchase goods with the use of a virtual shopping cart. It is used to prevent returning clients from being flagged as a new session or referral.

If you try to use the exclusion list to block the spam you’ll only blind Google Analytics from recognizing that the fake visits come from These same visits will keep appearing in your Google analytics, but not they’ll be listed as visits from nowhere (i.e. direct). You’ll have no way to tell which one is fake and which one isn’t.

Many people also recommend against using the .htaccess rules, but personally we’ve found that a mixed solution between a spam filter and this will wield the best results. You’ll find the detailed guide on how to do both below.

How to Block Referral Spam 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 Referral Spam 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} Referral Spam [NC,OR]
RewriteCond %{HTTP_REFERER} Referral Spam
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!

Leave a Comment