Blocking Referrer Spam in Analytic

By October 1, 2015 wordpress, WordPress Tutorials
Blocking Referrer Spam

Blocking Referrer Spam in WordPress Website

Blocking Referrer Spam is not an easy one to do unless you know few facts. It is one of the most abundant spam. The users google analytics is targeted in this spam to get traffic to the spammers site. This is a technique of passing fake referrer information in your google analytic. The fake links will appear in your analytic. This will lead you to some malicious site. I will try to explain in details on how to blocking referrer spam works  in WordPress Site. First we need to have Google Analytics setup in the WordPress site.

Setting up Google Analytics in WordPress Site

First of all you need to have Google Analytics installed in your site.  Google Analytics is a free tool by Google that helps you track how your website is interacting with visitors. If you do not have Google analytics installed in your Site you can check out our guide on installing Google Analytics to your WordPress Site.

There is much to learn in Google Analytics. We have a resource on how to make the most out of Google Analytics. You can have a look and get the benefits from this excellent tool.

Once the Analytics is installed you can proceed with following sections. to start Blocking Referrer Spam Links from your Analytics.

All About Referrer Spam

When we hear about Spam, we think of something big. Yes, It is big. But it does not have a huge impact technically. This is just a technique of showing spam link in your Google Analytics Dashboard. If you do not get keen and click on it then probably there is no harm. This way the spammer are just acquiring traffic for their site. Millions of sites are spammed daily. There is a chance that many people will get curious and want to explore more about the referral link.

Blocking Referrer Spam

If you have a good look in to the below image, you will find that the bounce rate is 100% or 0% and the new session is either 100% or 0%. This way you know that this is a referrer spam. This is not a proper way but this is an easier way to identify the referrer spam. Automated script are used to spam thousands and millions of site in a go.

Why Blocking Referrer Spam is Necessary?

Although the referrer spam may not look that bad but it is always a good option to block it. Now talking about blocking referrer spam, there are few crucial points to note.

The spam is harmless but it does have some negative effects.

It will ruin your analytics reports. This links counts can render the result inconsistent. In fact, if you want to show your analytics report to some of your clients or buyer. Impression is all that it can give. But impression is whats matters when you want to sell your site.

There are many ways for blocking referrer spam. Most of them are discussed below.

Blocking Referrer Spam using .htaccess

This is the most efficient trick for blocking referrer spam. The only drawback is that it needs to be updated periodically. You need to update and add referrer url to your .htaccess file.

Below is the code

# Referrer SPAM
<IfModule mod_rewrite.c>
# semalt
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*semalt\.com [NC] RewriteRule (.*) [R=301,L] # semaltmedia
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*semaltmedia\.com [NC] RewriteRule (.*) [R=301,L] # best-seo-solution
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*best-seo-solution\.com [NC] RewriteRule (.*) [R=301,L] # best-seo-offer
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*best-seo-offer\.com [NC] RewriteRule (.*) [R=301,L] # buttons-for-website
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*buttons-for-website\.com [NC] RewriteRule (.*) [R=301,L] # simple-share-buttons
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*simple-share-buttons\.com [NC] RewriteRule (.*) [R=301,L] # buttons-for-your-website
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*buttons-for-your-website\.com [NC] RewriteRule (.*) [R=301,L] # get-free-traffic-now
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*get-free-traffic-now\.com [NC] RewriteRule (.*) [R=301,L] # sharebutton
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*sharebutton\.net [NC] RewriteRule (.*) [R=301,L] # buy-cheap-online
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*buy-cheap-online\.info [NC] RewriteRule (.*) [R=301,L] # free-share-button
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*free-share-button\.com [NC] RewriteRule (.*) [R=301,L] # free-share-buttons
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*free-share-buttons\.com [NC] RewriteRule (.*) [R=301,L] #
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*100dollars-seo\.com [NC] RewriteRule (.*) [R=301,L] #
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*video--production\.com [NC] RewriteRule (.*) [R=301,L] #
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*videos-for-your-business\.com [NC] RewriteRule (.*) [R=301,L] # success-seo
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*success-seo\.com [NC] RewriteRule (.*) [R=301,L] # floating-share-buttons
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*floating-share-buttons\.com [NC] RewriteRule (.*) [R=301,L] # get-free-social-traffic
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*get-free-social-traffic\.com [NC] RewriteRule (.*) [R=301,L] # free-floating-buttons
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*free-floating-buttons\.com [NC] RewriteRule (.*) [R=301,L] # event-tracking
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*event-tracking\.com [NC] RewriteRule (.*) [R=301,L] # chinese-amezon
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*chinese-amezon\.com [NC] RewriteRule (.*) [R=301,L] </IfModule>

The above code contains the list of frequently spammer list but this list is huge. You need to update the list according to the links that appears in your Google Analytics dashboard.

Now after applying these filters you will still see this links for some time. Here is why:

  • The filters applied to requires 24 hrs before they are applied to your data.
  • The filters are applied from the time you use them and the previous data will be shown.
  • The filter is destructive, meaning the data will be lost permanently

Please wait for 30 days to get the list refreshed before the links are gone for good permanently.

Blocking Referrer Spam using Referral Exclusion List

This is another easy way to exclude the Referral spam using the Referral Exclusion list. Here is the details about the Referral Exclusion List. This article provides the brief about the Referral exclusion list of Google Analytics.

In short, You can include the domain name that is to be excluded from the google Analytics report. The excluded domain referrals will not be seen in the dashboard.

Problem with Referral Exclusion List

Spilling the beans here. The Referrer Exclusion List works sweet to exclude the referrals. But the hits are now counted as direct. It is blocking the referrer spam. But It is not blocking it from appearing in analytics report. If you are excluding the spam links and want to totally not consider the traffic and hit from spam then you would not want this list.

But if you have many domains and you want to consider the traffic from any of your domain to this domain as direct then you can use the Referral Exclusion List.

Now the solution for this is Using Analytics Filtering. Google Analytics filtering is an efficient module of Analytics that help you exclude or include host-names. This has a wide application. Check out the blog on How to use Google Analytics Filtering? This filter solution is very efficient.

Blocking Referrer Spam in WordPress using Plugin

There are countless plugins for Blocking Referrer Spam. The plugins are actively monitoring the link and block the referral spam efficiently. A fine Guy named Didier Sampaolo created an awesome plugin to help your block the referrer spam. The Plugin name is Spam Referrer Block. This is one efficient plugin that helps in Blocking Referrer Spam.

Install and Activate the plugin Spam Referrer Block in your WordPress Site.  Once the plugin is activated, go to Dashboard >> Settings >> Spam Referrer Block

Configure the plugin accordingly.

Spam referrer block plugin

You can include the list that you want to block. The list can be found in the Google Analytics dashboard as described above.  They also manage the list in their server constantly updated. You can download the list from the server for updated set of domains.

Once done, save it and it will start Blocking Referrer Spam. If you find this article helpful do share and spread the noise. Cheers.

Join the discussion One Comment

Leave a Reply

Enter the Captcha * Time limit is exhausted. Please reload CAPTCHA.