Block Google Analytics Referral Spam

Our comprehensive guide covers how you can successfully remove the referral from Google Analytics’ statistics.

Recently, many Google Analytics users reached us with a call for help regarding referral spam called This spam may cause some issues with the statistics in your Google Analytics by showing some fake traffic results, which may mess up your real statistics. Not having the real traffic information of your website and having it twisted can really be a major issue for some website owners and if you are one of them, this article may be of help. Here we are going to explain to you what is, and how you can effectively deal with it, by removing its tricky activity from your Google Analytics. In case you are facing fake traffic, generated by this referral spam, in the guide below you will find a few detailed steps that will show you exactly how to block it. Once you get rid of the spam, you will have information about the real website visitors, so you can keep track of the statistics and use them to develop your website strategies without misleading and fake visits, such as the ones caused by And if you want to block not only this spam but also prevent other similar referral spam issues from messing with your Google Analytics stats, the tips that we have for you below may be of help, so do take a few minutes to read them.

What is

As we already said above, is referral traffic that pollutes your Google Analytics statistics with fake visits that can be considered as a sort of web spam. You may find such referral spam called also Ghost spam and the reason is because, in fact, no real visitor comes to your website. Generally, this spam helps spammers promote their own websites by generating fake data. This data sticks to your site statistics and it can be extremely misleading if you rely on some realistic information about your real website traffic. This is the reason why many website owners, whose Analytics reports have been affected by referral spam, are seeking for ways to remove it and get a clear picture of their own site.

How can affect your website?

Generally, the worst that it could do is twist your website’s analytical data by giving you non-realistic statistics. For example, your bounce rate may reach up to 100% because when appears, it may land on your page and leave it the very same second. Or it may show you some fake web traffic information, which may not correspond to the real percentage of your site visits. This way, this spam may prevent you from reading the real Google Analytics data and simply mislead you.

Why would referral spammers use such spam?

The main reason for referral spam like to exist is that it helps the spammers promote their own services or website. This happens when you visit or search for the spam online, which automatically helps them get bumped to the top of the Google search engine results. Also, they may be spamming your site just to get a better ranking by creating backlinks. The goal is to make you visit their website by clicking on their link. Once you do that, you may be directed to some services or a product or land on an affiliate page. Generally, it is best to avoid clicking on such spam links, since the spammers may change them anytime and redirect you to any web location, even to an insecure one. Also, it is good to bear in mind that the referral spam practice falls in the category of black hat SEO, which Google does not tolerate. However, some spammers can get really creative in their attempts to get into your reports, that’s why keeping an eye on spam invasions like this one and learning how to block them is the best you could do to keep your website’s real statistics clean from misleading information.

How to effectively block

There are a lot of possibilities of handling referral spam on the web. However, not all of them can offer you a truly effective way to deal with it. That’s why, in this guide, we have listed some tested solutions, which will help you keep your data clean from spam and keep your Google Analytics optimized and safe. Take a look at them and let us know how they helped you solve your current issue.

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!

About the author


Lidia Howler

Lidia is a web content creator with years of experience in the cyber-security sector. She helps readers with articles on malware removal and online security. Her strive for simplicity and well-researched information provides users with easy-to-follow It-related tips and step-by-step tutorials.

Leave a Comment