My Blog

How to Block Unwanted Referral Traffic from Google Analytics report

We have been getting emails and messages on social media regarding unwanted and un-relevant traffic from spam sites, and it is spoiling the Google Analytics report of various small business owners and SEO folks such as mentioned by this guy in Google Groups.


Google Groups News

So here we are going to give you some tips and tricks to get rid of unwanted referral traffic.

Exclude all hits from known bots and spiders – (Admin > View Settings)

Google Analytics provides a facility to filter the bots “bot filtering” where you can block no-human referral traffic. It has two steps.

  • Go to “admin
  • Click on “view settings
  • Check the box of bot filtering (as shown below)


Google Analytics Bot Filtering


Difference between Ghost spam and Referral spam with best solution

Ghost spam is directly hit your Google Analytics (GA) and Referral spam hit your website for getting fake visits and promotions. Check image for more detail.

Google Analytics Spam Types

You can stop these spamming referrals at some extent from here. Some sites cannot be stopped by GA Bot Filtering, you will have to try another options as well.

How to block darodar forum & other spam referrals


Admin Filter (Admin > Filter > New Filter) – Here you can block any specific Domain by campaign source. it is very simple technique and has 4 simple steps.

  • Go to “admin” part
  • Click on “filters” (see it in the image 2)
  • Create “new filter
  • Follow steps according to image 3

(Create New Filter > Filter Name > Filter Type > Filter Field > Filter Pattern)

Be careful while putting url because wrong url will not help blocking or any filtering.

Image 2

Google Analytics Filters


Image 3

Campaign Source Filter


This technique only helpful for spam referrals not for ghost spam. You can also block more than one url. Use pipe “|” to separate spam url (without space).

Block Ghost Spam by Hostname filter (include)

  • If you are getting unhuman traffic from “events, (net-set) data, organic” also that means Ghost Spam
  • This technique is the best technique, suggested by all analytics experts
  • Use all valid hostnames and add them in hostnames filter – include
  • Check how to find valid hostnames, follow the the given image

Google Analytics Valid Hostname Check

list of all valid hostnames


Google Analytics Hostname Filter Setup


Filter pattern for hostnames

.*|.*|.* (no space)

First you have to use hostname filter than use campaign source filter if you still getting traffic from spamming referral sites

How to Block Any City/Region/Country in Google Analytics

  1. Login with Google Analytics account
  2. Go to in Admin section
  3. Then click on Filters
  4. And then add New filter and follow the given steps in image

Google Analytic Filter for Country Region City


How to block Spam or personal IP Address in Google Analytics

Visits from Personal system or from personal office area is worthless so you can block it easily by Filters

Just Follow images and block Spam referral IP or unwanted IP

Google Analytics Blocking Ip Address

Personal IP Block in Google Analytics

Exclude Internal Traffic Google Analytics

Block spam language in Google Analytics

If you are getting spam traffic from unknown language (check examples in image) then you can block them by using language filter.

Follow given steps…

  1. Login with Google Analytics account
  2. Go to in Admin section
  3. Then click on Filters > Custom Filter > Exclude > Language Setting
  4. Add given text in filter pattern\s[^\s]*\s|.{15,}|\.|,
    Copy this regular expression code and paste same in your filter pattern. Check image for details…

BonusFilter takes 24 hours to work properly. Click on “verify filter”  to save your time. You can take maximum 255 characters in filter pattern and also add more than one ghost spam by using pipe “|” separator.

We hope that these tricks will help you to create correct Google Analytics report with actual traffic coming to your site instead of wrong traffic prediction due to unwanted referral by different bots.

Cgcolors is a  web design and SEO based company with office at New York.  We are here to help small business and share the knowledge with outstanding SEO folks.



Nick userHow to Block Unwanted Referral Traffic from Google Analytics report

Related posts


Join the conversation
  • Anonymous - May 24, 2017

    I don’t even understand how I stopped up here, but I assumed this put up was once great.
    I don’t recognise who you are however certainly you’re going to a famous blogger in the
    event you aren’t already. Cheers!

  • Pankaj - July 31, 2015

    Thank you for sharing this information it’s really helpful I blocked all spam traffic using this method.

  • Sameer Kumar - June 18, 2015

    Really appreciate this article! It really helped us to exclude the referral traffic from the spam sites. Also restrict the hits to server by using .htaccess file. Thanks for sharing the wonderful article.

  • Jeroen Houtman - May 21, 2015

    Does adding filters remove the referral trafic from current data or just from newly generated data?
    It does not seem to change anything to current data. Maybe I’m doing something wrong!

    Attila - June 17, 2015

    Adding filters will affect only the newly generated data.

  • Jesse B. - May 18, 2015

    Thank-you for this set of detailed instructions!
    Initially I was over-the-moon to see that my site had generated a huge amount of traffic, but when I drilled down into the Referrals I was pretty dismayed to see that majority had been from spammy sites. I’ve just actioned all the above steps you’ve provided in the article. Appreciate you sharing the advice. Nothing worse than finding that your data integrity has been compromised – hopefully this will have done the trick!

    Josh - May 21, 2015

    Hi Jesse, Let me know if these tips worked for you.

  • rosy - May 3, 2015

    i have been getting traffic from two dirty site ( and to my website. i tried to shop that by .htaccess file but, that’s not work now i want to stop that with
    var block = [‘url One’, ‘url Two’];
    for (var b = block.length; b–;) {
    if (document.referrer.match(block[b]))
    window.location = “”;

    this script .
    If i redirect those dirty sites to is this right thing.

    admin - May 4, 2015

    no problem rosy

Comments are closed.