What is referral spam and how to remove referral spam from Google Analytic and htaccess File

Referral Spam

The Referral spam is the superfluous spam or traffic that is voluntarily entered into the website and creates the squalid and jeopardous spamming. It straightforwardly exaggerates the traffic and depreciates conversion rates artificially. When Google crawls the websites, then it also ponders that spamming URLs or spam bots, which in return the spammer gets benefited via the other virtuous websites. Actually, the spammers get a perk utilizing the ethical methods by other means. In short, Google Analytics records this fake traffic. The bots crawl and index all the stuff that comes in its way and thus, the malicious content too.


Yet, bots or crawlers are the nuclear components of Google or any other search engine, however, at jiffy, these bots are proved to be malicious rationales also:

  • For the click fraud
  • Scrape website content
  • Spread malwares
  • Augments traffic, artificially

Multifarious spam referrals are prevailing in this contemporary trend and hybrid ways can be employed to tackle with them:

  1. Ghost Referrals like the darodar.com/buy-cheap-online.info/pornhub-forum.ga
  2. Creepy Crawlers like semalt and fake referrals like maridan.com.ua and blog.ranksonic.com.

Removal of Referral Spam using Google Analytics:

Three ways to deal with these spammers:

  • Create a filter by hostname

Create a new filter on your View. Manage it to Include only the traffic going to the hostname of your site. In this case, it encompasses the traffic that has a hostname that includes blackbeltrobots.com. You can swap blackbeltrobots.com with your own domain.

  • Create a filter by campaign source

Create a new custom filter on your View. Set it to Exclude, Filter Field to Campaign source and in the Filter Pattern field and you can enter the domains you want to exclude. Apply this filter for each view, distinctly.

  • Bot Filtering

Check the Exclude all hits from known bots and spiders option. However, apply new filters and domain exclusions will only Google Analytics only execute at the moment when you add them. Your past history is still affected, if you exclude these domains.


google analytics-

google analytics


Removal of Referral Spam using htaccess:

Referral spam is the nuisance that is created by the malevolent softwares and it significantly impacts the websites and their ranks. Due to these spams, legitimate users will be greeted with the slow or non-responsive websites. Htaccess blocks the certain referral spamming websites. Multifarious approaches are employed to prevent referral spam.

  1. One way is to force the error and put a hindrance to any further direction. This requires ‘mod_rewrite’to be enabled on the server.

                      RewriteCond %{HTTP_REFERER} sitetoblock\.com [NC]

                      RewriteRule .* – [F,L]


The above code is followed by the Apache server to eradicate the traffic from the URL ‘sitetoblock.com’.  The ‘[NC]’ flag specifies that the URL of the referral site is not case-sensitive. The ‘F’ flag in [F,L] returns a ‘403 Forbidden’ error, whereas ‘L’ flag ceases the further processing.

  1. The other method is to redirect the URl to either the public websites or return back to the referral website.
  • Code for the public website:

        RewriteCond %{HTTP_REFERER} sitetoblock\.com [NC]

        RewriteRule .* http://www.google.com [R,L]

  • Code for the referral website:

        RewriteCond %{HTTP_REFERER} sitetoblock\.com [NC]

        RewriteRule .* %{HTTP_REFERER} [R,L]

  1. An alternative way is to return a 301 error.

        RewriteCond %{HTTP_REFERER} ^http://www\.sitetoblock\.com

        RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]


A referral spam occurs when your website receives the counterfeit referral traffic from the nasty softwares and this traffic is recorded by the Google Analytics. To eradicate them has become the most imperative component in the prevailing tide and it is damn requisite for enhancing the online visibility of the websites.

SEO company in Liverpool can help you stopping referrer-spam from your website. contact us for more details.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.