How to block referrer spam

Referrals from can cause huge problems for many webmasters, website owners, and those who provide website services for their clients. referrer spam can ruin Google Analytics metrics and other analytical data. It can also use bandwidth and cause confusion for new website owners who do not understand why their websites are getting referral traffic from

The guide on this webpage will help you block referrer spam in Google Analytics and will also help you block referrer spam at the source using your website’s .htaccess file.

What is is a website that engages in referrer spam indexing tactics aimed at website analytical data. referrer spam is designed to create repeated site requests to the website. The benefits that referral spammers have with this tactic is that it will help them advertise the website they want people to visit and it will also improve the spammers search engine ranking. The downside is that referrals from can interfere with Google Analytics data and other metrics, as well as use a website’s bandwidth by creating repeat requests.

How to block referrer spam in Google Analytics

To block referrer spam in Google Analytics follow the instructions below. Blocking referrer spam in Google Analytics 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.

How to block referrer spam 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]
RewriteRule .* - [F]

Sean Doyle

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