How to block referral traffic (Referrer Spam)

How to block referral traffic (Referrer Spam)

Many webmasters, website owners, bloggers, and search engine marketers have been complaining about referral traffic in their Analytics. Unwanted referral traffic from can ruin your Google Analytics data, including the Audience, Acquisition, and Behavior analytical data sections. For example, referral traffic can ruin the bounce rate, geography information, and basically everything else found in the Audience, Acquisition, and Behavior sections. The bounce rate is affected by referrer spam because the spam URL only lands on a single webpage and leaves from the same webpage. referral traffic

The guide on this page will help you block referral traffic in Google Analytics and block referrer spam using your website’s .htaccess file in order to stop receiving unwanted referral traffic from

What is is a pornography (erotic) website that willingly engages in referrer spam indexing tactics aimed at your website’s analytical data. referrer spam is designed to create repeated site requests onto your website at any given time and from any location using traffic bots and other blackhat SEO tactics. The benefits that spammers have by engaging in referrer spamming is that it will help them advertise the website they want people to visit and it will improve the spammers search engine ranking by creating backlinks to their website off your website’s access log. The downside is that referrals from can interfere with your Google Analytics data and other metrics, as well as use a website’s bandwidth by creating repeat site requests and make it look like your website is linked to pornography.

Referrer spam is a very questionable tactic used to promote online content. Spammers target the referral traffic of your website for several reasons:

  • Spammers want to promote a webpage and want you to visit the webpage or search for it online – and visit it through Google search engine results pages.
  • Spammers want to boost their rank on Google search engine results pages by creating backlinks. They do this by logging requests into your website’s access log, which is then crawled by Google and seen as a backlink to the spam site. referrer spam is not entirely dangerous to your website. It will most likely not cause any trouble with how your website is accessed by your visitors or ranked by Google. However, in some cases spam may use up your website’s bandwidth and CPU by creating multiple site requests to your website. In other cases, the spam URL is served to your analytical data by traffic bots which create ghost hits and never actually land on your website.

1. How to block referral traffic in Google Analytics

To stop referrer spam in Google Analytics follow the instructions below. Blocking referrer spam in Google Analytics by creating an exclude filter will only mask the spam URL. To block the referrer spam URL at the sources please see the instructions below to block referrer spam using your website’s .htaccess file.

1. Open your Google Analytics account and go to the Admin tab and click All Filters.

how to block referrer spam

2. Click the New Filter button to create a new filter.

block referrer spam

3. Add as the Filter Name.

4. Select the Custom Filter Type.

block referrer spam google analytics

5. In Filter Field, find and select Campaign Source in the list. In the Filter Pattern text box, add and click the Save button on the bottom of the webpage.

2. How to block referral traffic using your .htaccess file

To block referrer spam at the source using your .htacess file add the code below to your .htaccess file.

RewriteCond %{HTTP_REFERER} [NC,OR]
RewriteCond %{HTTP_REFERER}
RewriteRule .* - [F]

Sean Doyle

Sean Doyle is an engineer from Los Angeles, California. Sean's primary focuses include Internet Security, Web Spam, and Online Marketing.

Comments ( 4 )

  1. Replykamren
    Thank you that was good from sockbroker website
  2. Replywpmu
    Thanks! Very helpful! without you I would not be able to stop it!!!! Cheers!!
    • Replywpmu
      Acctually I got a 403 error code after adding these lines to my .htaccess How can I use it in a safe way? Thanks!
      • ReplyAuthorSean Doyle
        If you're having issues I would recommend to create a Google Analytics filter. If you are adding a code to your htaccess file make sure to add it in a clear space, most preferably at the bottom of the file.