What Is Referrer Spam & How Can You Block It

If you constantly dig around in your Analytics software looking for opportunities and insights you have likely noticed referrer spam. Used for quite a long time but taken to a new level by a company called semalt.com (which calls itself an SEO tool) essentially this method of ‘advertising’ is where your website is flooded with traffic from all different countries, IP addresses, devices and at different times during the week but all with the same website referrer. The hope of these spammers is that you will then notice the traffic in your analytics and investigate why the website is linking to you – to then convert to their service, or buy their product.

With Semalt’s ‘succcess’ with this type of advertising, referrer spam is now being used by many websites and has reached a level where its corrupting and distorting web analytics. In the past week alone here is some of the referrer spam that has been hitting my website:

referrer-spam

There are two main types of referrer spam with different methods to block each:

  • Crawler Referrer Spam: this spam actually crawls through your site with a fake referrer URL or campaign source. This spam can either be blocked from the server, filtered in Analytics or both.
  • Ghost Referrer Spam: this spam bypasses your website completely and sends traffic directly into your Analytics account. The only way to remove this spam is by filtering it from Analytics.

A number of websites have decided to breakdown each offending spam URL by which type it is Crawler or Ghost however its so easy for a spammer to switch their method once they stop getting results that I think its better to use both methods to block all URLs no matter what method they use. So far, here are the worst offenders that I have found and blocked from my site (read on for how to block them):

  • 100dollars-seo.com
  • 4webmasters.org
  • 7makemoneyonline.com
  • acads.net
  • adcash.com
  • addons.mozilla.org/en-US/firefox/addon/ilovevitaly/
  • alibestsale.com
  • aliexpress.com
  • anal-acrobats.hol.es
  • anticrawler.org
  • best-seo-offer.com
  • best-seo-solution.com
  • best-seo-software.xyz
  • bestwebsitesawards.com
  • blackhatworth.com
  • black-friday.ga
  • brakehawk.com
  • buttons-for-website.com
  • buttons-for-your-website.com
  • buy-cheap-online.info
  • cenokos.ru
  • cenoval.ru
  • cityadspix.com
  • copyrightclaims.org
  • cyber-monday.ga
  • darodar.com
  • domination.ml
  • e-buyeasy.com
  • econom.co
  • edakgfvwql.ru
  • erot.co
  • event-tracking.com
  • floating-share-buttons.com
  • forum69.info
  • free-floating-buttons.com
  • free-share-buttons.com
  • free-social-buttons.com
  • Get-Free-Traffic-Now.com
  • get-free-social-traffic.com
  • gobongo.info
  • googlsucks.com
  • guardlink.org
  • hulfingtonpost.com
  • humanorightswatch.org
  • ilovevitaly.co
  • ilovevitaly.com
  • ilovevitaly.ru
  • iminent.com
  • iskalko.ru
  • kabbalah-red-bracelets.com
  • kambasoft.com
  • justprofit.xyz
  • lsex.xyz
  • luxup.ru
  • makemoneyonline.com
  • masterseek.com
  • myftpupload.com
  • o-o-6-o-o.com
  • o-o-8-o-o.com
  • o-o-6-o-o.ru
  • o-o-8-o-o.ru
  • ok.ru
  • pornhub-forum.ga
  • pornhub-forum.uni.me
  • priceg.com
  • prlog.ru
  • qualitymarketzone.com
  • ranksonic.info
  • ranksonic.org
  • ranksonic.net
  • rapidgator-porn.ga
  • sanjosestartups.com
  • savetubevideo.com
  • scansafe.net
  • screentoolkit.com
  • semalt.com
  • semaltmedia.com
  • seoexperimenty.ru
  • seo-platform.com
  • sexyteens.hol.es
  • sexyali.com
  • simple-share-buttons.com
  • slftsdybbg.ru
  • smailik.org
  • snip.to
  • social-buttons.com
  • socialseet.ru
  • success-seo.com
  • superiends.org
  • top1-seo-service.com
  • theguardlan.com
  • traffic2money.com
  • traffic2cash.org
  • trafficmonetizer.org
  • vodkoved.ru
  • webmaster-traffic.com
  • webmonetizer.net
  • websocial.me
  • ykecwqlixx.ru
  • youporn-forum.ga
  • youporn-forum.uni.me
  • video–production.com

I’m all for innovative and new marketing techniques, especially when they are low cost for high potential return on investment (referrer spam definitely falls under this category) however for my websites, and likely yours, it is annoying and can lead to incorrect decisions being made or opportunities missed. I predict that it won’t be long until Google Analytics, Piwik and the other big web analytic companies start blocking this form of spam automatically but if you are sick of your data being corrupted now there are a few easy ways to stop these sites albeit one at a time as you notice them.

Blocking Crawler Referrer Spam With Your .htaccess File

The simplest way to stop crawler referrer spam (which is actually crawling your site) is to simply ban the traffic from hitting your website. If you are using an Apache server you can do this by editing your .htaccess file. Take a backup of the file then do a search of its contents and see if it already has the line “RewriteEngine On” in it. If it doesn’t simply copy and paste the below code into your .htaccess file to block the sites I have found, if it does, copy and paste the code below but remove the “RewriteEngine On” line:

## STOP REFERRER SPAM ##
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?100dollars-seo\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?4webmasters\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?7makemoneyonline\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?acads\.net [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?adcash\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?addons\.mozilla\.org/en-US/firefox/addon/ilovevitaly/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?alibestsale\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?aliexpress\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?anal-acrobats\.hol\.es [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?anticrawler\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?best-seo-software\.xyz [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?best-seo-offer\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?best-seo-solution\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?bestwebsitesawards\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?black-friday\.ga [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?blackhatworth\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?brakehawk\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?buttons-for-website\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?buttons-for-your-website\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?buy-cheap-online\.info [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?cenokos\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?cenoval\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?cityadspix\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?copyrightclaims\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?cyber-monday\.ga [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?darodar\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?domination\.ml [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?e-buyeasy\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?econom\.co [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?edakgfvwql\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?erot\.co [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?event-tracking\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?floating-share-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?forum69\.info [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?free-floating-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?free-share-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?free-social-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?Get-Free-Traffic-Now\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?get-free-social-traffic\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?gobongo\.info [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?googlsucks\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?guardlink\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?hulfingtonpost\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?humanorightswatch\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?justprofit\.xyz [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ilovevitaly\.co [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ilovevitaly\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ilovevitaly\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?iminent\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?iskalko\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?kabbalah-red-bracelets\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?kambasoft\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?luxup\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?lsex\.xyz [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?makemoneyonline\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?masterseek\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?myftpupload\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?o-o-6-o-o\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?o-o-6-o-o\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?o-o-8-o-o\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?o-o-8-o-o\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ok\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?pornhub-forum\.ga [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?pornhub-forum\.uni\.me [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?priceg\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?prlog\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?qualitymarketzone\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ranksonic\.info [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ranksonic\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ranksonic\.net [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?rapidgator-porn\.ga [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?sanjosestartups\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?savetubevideo\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?scansafe\.net [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?screentoolkit\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?semalt\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?semaltmedia\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?seoexperimenty\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?seo-platform\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?sexyteens\.hol\.es [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?sexyali\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?simple-share-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?slftsdybbg\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?smailik\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?snip\.to [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?social-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?socialseet\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?success-seo\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?superiends\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?top1-seo-service\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?traffic2money\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?traffic2cash\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?trafficmonetizer\.org [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?theguardlan\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?vodkoved\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?webmaster-traffic\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?webmonetizer\.net [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?websocial\.me [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?ykecwqlixx\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?youporn-forum\.ga [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?video–production\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^([^.]+.)*?youporn-forum\.uni\.me [NC]
RewriteRule .* – [F]
## STOP REFERRER SPAM ##

As you then find new websites to add (let me know in the comments if you do), simply add an extra line per site changing the domain name (ensure your last line still has [NC] instead of [NC,OR]):

RewriteCond %{HTTP_REFERER} ^([^.]+.)*?domain\.com [NC,OR]

Alternative .htaccess Method To Block Crawler Referrer Spam

As you can see below in the comments, occasionally the above method has been reported to slow peoples websites or admin areas for their CMS. If this happens to you then remove all of the code above and try the following code instead:

## STOP REFERRER SPAM ##
SetEnvIfNoCase Referer 100dollars-seo.com spambot=yes
SetEnvIfNoCase Referer 4webmasters.org spambot=yes
SetEnvIfNoCase Referer 7makemoneyonline.com spambot=yes
SetEnvIfNoCase Referer acads.net spambot=yes
SetEnvIfNoCase Referer adcash.com spambot=yes
SetEnvIfNoCase Referer addons.mozilla.org/en-US/firefox/addon/ilovevitaly/ spambot=yes
SetEnvIfNoCase Referer alibestsale.com spambot=yes
SetEnvIfNoCase Referer aliexpress.com spambot=yes
SetEnvIfNoCase Referer anal-acrobats.hol.es spambot=yes
SetEnvIfNoCase Referer anticrawler.org spambot=yes
SetEnvIfNoCase Referer best-seo-offer.com spambot=yes
SetEnvIfNoCase Referer best-seo-solution.com spambot=yes
SetEnvIfNoCase Referer bestwebsitesawards.com spambot=yes
SetEnvIfNoCase Referer black-friday.ga spambot=yes
SetEnvIfNoCase Referer blackhatworth.com spambot=yes
SetEnvIfNoCase Referer brakehawk.com spambot=yes
SetEnvIfNoCase Referer buttons-for-website.com spambot=yes
SetEnvIfNoCase Referer buttons-for-your-website.com spambot=yes
SetEnvIfNoCase Referer buy-cheap-online.info spambot=yes
SetEnvIfNoCase Referer cenokos.ru spambot=yes
SetEnvIfNoCase Referer cenoval.ru spambot=yes
SetEnvIfNoCase Referer cityadspix.com spambot=yes
SetEnvIfNoCase Referer copyrightclaims.org spambot=yes
SetEnvIfNoCase Referer cyber-monday.ga spambot=yes
SetEnvIfNoCase Referer darodar.com spambot=yes
SetEnvIfNoCase Referer domination.ml spambot=yes
SetEnvIfNoCase Referer e-buyeasy.com spambot=yes
SetEnvIfNoCase Referer econom.co spambot=yes
SetEnvIfNoCase Referer erot.co spambot=yes
SetEnvIfNoCase Referer edakgfvwql.ru spambot=yes
SetEnvIfNoCase Referer event-tracking.com spambot=yes
SetEnvIfNoCase Referer floating-share-buttons.com spambot=yes
SetEnvIfNoCase Referer forum69.info spambot=yes
SetEnvIfNoCase Referer free-share-buttons.com spambot=yes
SetEnvIfNoCase Referer free-social-buttons.com spambot=yes
SetEnvIfNoCase Referer Get-Free-Traffic-Now.com spambot=yes
SetEnvIfNoCase Referer gobongo.info spambot=yes
SetEnvIfNoCase Referer googlsucks.com spambot=yes
SetEnvIfNoCase Referer guardlink.org spambot=yes
SetEnvIfNoCase Referer hulfingtonpost.com spambot=yes
SetEnvIfNoCase Referer humanorightswatch.org spambot=yes
SetEnvIfNoCase Referer ilovevitaly.co spambot=yes
SetEnvIfNoCase Referer ilovevitaly.com spambot=yes
SetEnvIfNoCase Referer ilovevitaly.ru spambot=yes
SetEnvIfNoCase Referer iminent.com spambot=yes
SetEnvIfNoCase Referer iskalko.ru spambot=yes
SetEnvIfNoCase Referer kabbalah-red-bracelets.com spambot=yes
SetEnvIfNoCase Referer kambasoft.com spambot=yes
SetEnvIfNoCase Referer lsex.xyz spambot=yes
SetEnvIfNoCase Referer luxup.ru spambot=yes
SetEnvIfNoCase Referer makemoneyonline.com spambot=yes
SetEnvIfNoCase Referer masterseek.com spambot=yes
SetEnvIfNoCase Referer myftpupload.com spambot=yes
SetEnvIfNoCase Referer o-o-6-o-o.com spambot=yes
SetEnvIfNoCase Referer o-o-8-o-o.com spambot=yes
SetEnvIfNoCase Referer o-o-6-o-o.ru spambot=yes
SetEnvIfNoCase Referer o-o-8-o-o.ru spambot=yes
SetEnvIfNoCase Referer ok.ru spambot=yes
SetEnvIfNoCase Referer pornhub-forum.ga spambot=yes
SetEnvIfNoCase Referer pornhub-forum.uni.me spambot=yes
SetEnvIfNoCase Referer priceg.com spambot=yes
SetEnvIfNoCase Referer prlog.ru spambot=yes
SetEnvIfNoCase Referer ranksonic.info spambot=yes
SetEnvIfNoCase Referer ranksonic.org spambot=yes
SetEnvIfNoCase Referer ranksonic.net spambot=yes
SetEnvIfNoCase Referer rapidgator-porn.ga spambot=yes
SetEnvIfNoCase Referer sanjosestartups.com spambot=yes
SetEnvIfNoCase Referer savetubevideo.com spambot=yes
SetEnvIfNoCase Referer scansafe.net spambot=yes
SetEnvIfNoCase Referer screentoolkit.com spambot=yes
SetEnvIfNoCase Referer semalt.com spambot=yes
SetEnvIfNoCase Referer semaltmedia.com spambot=yes
SetEnvIfNoCase Referer seoexperimenty.ru spambot=yes
SetEnvIfNoCase Referer sexyteens.hol.es spambot=yes
SetEnvIfNoCase Referer sexyali.com spambot=yes
SetEnvIfNoCase Referer simple-share-buttons.com spambot=yes
SetEnvIfNoCase Referer slftsdybbg.ru spambot=yes
SetEnvIfNoCase Referer smailik.org spambot=yes
SetEnvIfNoCase Referer snip.to spambot=yes
SetEnvIfNoCase Referer social-buttons.com spambot=yes
SetEnvIfNoCase Referer socialseet.ru spambot=yes
SetEnvIfNoCase Referer success-seo.com spambot=yes
SetEnvIfNoCase Referer superiends.org spambot=yes
SetEnvIfNoCase Referer top1-seo-service.com spambot=yes
SetEnvIfNoCase Referer theguardlan.com spambot=yes
SetEnvIfNoCase Referer trafficmonetizer.org spambot=yes
SetEnvIfNoCase Referer traffic2cash.org spambot=yes
SetEnvIfNoCase Referer vodkoved.ru spambot=yes
SetEnvIfNoCase Referer webmaster-traffic.com spambot=yes
SetEnvIfNoCase Referer webmonetizer.net spambot=yes
SetEnvIfNoCase Referer websocial.me spambot=yes
SetEnvIfNoCase Referer ykecwqlixx.ru spambot=yes
SetEnvIfNoCase Referer youporn-forum.ga spambot=yes
SetEnvIfNoCase Referer video–production.com spambot=yes
SetEnvIfNoCase Referer youporn-forum.uni.me spambot=yesOrder allow,deny
Allow from all
Deny from env=spambot
## STOP REFERRER SPAM ##

The above steps will just take care of the traffic actually crawling your site, unfortunately this isn’t enough to filter out Ghost Referrer Spam however. As mentioned previously I recommend implementing all the steps on this page for every URL you find to ensure the best chance of blocking all the spam.

Filtering Ghost & Crawler Referrer Spam In Google Analytics

The above .htaccess changes will take care of spam that is actually hitting your website but the crafty spammers have also invented “Ghost Referrer Spam”, essentially this spam hits Analytics directly bypassing your website. To filter out this spam (and crawler spam) from Google Analytics, first navigate to the ‘Filters’ tab found under ‘Admin’ → ‘View’, click ‘New Filter’ and then select the ‘Custom’ Filter Type. Pick the Filter Field of ‘Referral’ and for the Filter Pattern put the domain of the site you want to block (for example ‘semalt.com’). Repeat this process for each spam website you’ve picked up in your data and going forward this traffic will not be shown. Unfortunately this cannot retrospectively filter any traffic so remember to put a note in your Annotations reminding you of the date the filters were set up.

referrer-spam2

You can add multiple domains at once using Regex in the following format (ie. domain1.com|domain2.com|domain3.com etc) but there is a character limit for filters so you may need to do this several times. Some websites also recommend filtering this traffic out using “Campaign Source” instead of “Referrer” in the Filter Field setting. I was able to block all the sites using just my method however if you want to be safe you could also duplicate your filters filtering all of the URLs once as Referrers, and once as Campaign Sources.

Once you have filtered all your known bots navigate to ‘Admin’ → ‘View Settings’ and then ensure ‘Exclude all hits from known bots and spiders’ is selected which will ensure when Google finally updates Analytics to filter this spam it will be excluded from your data automatically if thats the option they decide to use to enable/disable filtering:

referrer-spam3

If you don’t have time to keep your filters up to date then I would also recommend you read on and add Hostname filtering which will automatically block a lot of Ghost Referrer Spam no matter what URL they use.

Automatically Filtering Ghost Referrer Spam In Google Analytics

Whilst the operators of Referrer Spam are getting smarter and smarter there are some types of Ghost Referrer Spam that are very easy to detect and block. This type of spam is essentially where they send out huge volumes of fake traffic to every Analytics UA code imaginable (ie. UA-11111111-1, then UA-11111112-1 etc.), the issue is by just sending out the fake data to a UA code they don’t actually know the site that the Analytics code is meant to be on. When someone views a page which has Analytics, Google is sent the URL that the Analytics code was viewed on as the “Hostname” which is viewable in Analytics. Heres how that data should look:
referrer-hostname

As you can see on this example the website roimarketing.co.nz is showing as the Hostname meaning the Analytics code was shown on this URL, great! However the Ghost Referrer Spam that is using your UA code can’t know your URL will show as this:

referrer-hostname2

As you can see they have either not sent any Hostname at all or faked/guessed random Hostnames. If you can’t think of any legitimate reason at all that your Analytics code would be there then its more than likely spam. To filter out these hits with an incorrect Hostname simply do a quick check of all your traffic for the past year and look through the Hostnames looking for anything legitimate that is or could be related to your site. Examples of legitimate URLs that are not your site could be shopify.com if you have a checkout process that goes offsite and that you’ve placed your Analytics code on, Google translation (translate.googleusercontent.com) and cache services (webcache.googleusercontent.com) or alternative versions of your URL (ie. non-www vs www).

Once you have built your list of legitimate domains put them in Regex format (ie. www.roimarketing.co.nz|translate.googleusercontent.com|webcache.googleusercontent.com|roimarketing.co.nz) and then Create A New Filter, selecting a Custom Type and making sure to click “Include” instead of the default “Exclude” option. Select a Filter Field of Hostname and then copy and paste your regex list of authorised URLs into the Filter Pattern and hit save.
referrer-hostname3

Now your Analytics will filter out all traffic not in your list of authorised domains. Be wary that this could cause major tracking issues if you leave out any URL which is valid and ensure you double check your list and make sure to leave an unfiltered GA profile in case anything goes wrong. Plus ensure any new URLs you want to track are added on the traffic on these URLs will be filtered out.

Whilst these methods are not foolproof and there are a lot more methods (there is some more at this great post) they should get most of the spam hitting your site.

If you’re not on an Apache server or aren’t using Google Analytics there are lots of guides around about this issue which is clearly riling up more than a few website owners so find the one that suits you and get rid of your Analytics data corruption for good.

Duncan Jones

About The Author - Duncan Jones

I am a growth marketing specialist from New Zealand and im passionate about growing businesses through creative and performance focused digital marketing. I insist on tracking everything, follow proven growth processes and I still love the thrill of getting a first conversion then optimising & scaling the campaigns for clients across a huge range of industries. You can find me on LinkedIn here, find out how to hire me here or you can contact me here.

51 Comments

    • Hey Vane, We have updated our article to make it easier to understand based on your question. Essentially all you need to do is copy the code above to your htaccess file and save it (backup first!). Then in the future if you have any additional referrer domains to add just duplicate the one line of code (the semalt one is an example) and update the domain name. Let us know if you need anymore help.

  1. If I do the “Exclude all hits from known bots and spiders” via the adam tab as you said, do I still need to do the block in the .htaccess file?

    • Hey Jon, hopefully one day! At the moment checking the box in the admin tab does not stop the referrer spam showing up in Google Analytics. We are sure it won’t be long before it does however for now we recommend using all 3 options above. Any other questions, let us know.

  2. Man, thank you for this! I was having so much trouble with bots, messing up my analytics!

  3. Thanks for this, found 2 more for your list 🙂

    forum20.smailik.org
    forum.topic38386778.darodar.com

  4. Hi! Thanks for a great article. Quick question: in your htaccess file snippet, is there any reason why the RewriteCond for all domains is [NC,OR] – except for simple-share-buttons.com which is just [NC] only?

  5. Hi all,

    We have block several spam now.
    But the last days we get traffic from site26.simple-share-buttons.com when we block site 26, the other day there’s site 29 and so on. It’s really annoning and frustrating. What can we do about it?

    • If you follow the methods above and just use the domain name when blocking/filtering (simple-share-buttons.com) then it will also ban all sub domains.

  6. Thank you for this very useful article! On my own website I have found one more spammer for your list: 4webmasters.org

  7. Hi, thanks for this,
    I can’t stop social-buttons.com by adding to a .htaccess file,
    any other solutions for this problem?
    Thank you.

  8. Hi, thanks for the article! My question is where exactly should I put the code in the htaccess file? My htaccess looks like this: # BEGIN WPSuperCache
    # END WPSuperCache

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress
    Should I put it after the whole code?
    Thanks for an answer!!

  9. It looks like it doesnt work, because I had today 36 visits from site37.simple-share-buttons.com. Do you have any idea why? I put the code after # END WordPress. Is it correct? Thanks!

  10. I’ve been fighting this by trying to find out the agent name then using a ‘deny’ line in htacess. This method is so much simpler! Thanks!

  11. This article was really helpful. I could not figure out for the life of me how to block social-buttons.com and googlsucks.com from my website https://privateloanshop.com. I’ve implemente the GA method and I hope that does it. Thanks for sharing.

  12. One of the entries in my htaccess file doesn’t seem to be working. Here’s the line from my htaccess:
    RewriteCond %{HTTP_REFERER} ^([^.]+.)*?hulfingtonpost\.com [NC,OR]
    And yet this referrer – editors.choice19298092.hulfingtonpost.com – turned up in my Analytics.
    Any idea how that crept though? Thanks!

    • Hey Zarg, as far as we know some craft spammers have figured out how to send a fake request direct to Analytics bypassing your website which means it will show in Analytics. I suggest also setting up the Filters in Analytics as outlined in this article.

  13. Here’s another for you: theguardlan.com
    Maybe if enough people keep playing this whack-a-mole they will get fed up with the price of buying new domains…

  14. Not sure why but after adding this code to my htaccess file, my whole site takes about a minute more to lead each page than before. Any quick fixes for that?

  15. When doing this via the .htaccess file, we noticed that there was a huge impact to site speed, and it reduced performance a LOT. I wouldn’t recommend this method, as the more pages you have on the site, the slower it’ll make it since with every request they were checking the referrer multiple times and it added up a lot.

    Perhaps this could also be done within php itself? I would be interested to hear if anyone had a difference experience in terms of site speed impacts, as it slowed down 4 websites to be almost unusable.

    • Hey Victoria, this isn’t an issue we have had with the code but others are experiencing slower speeds in the last few days. Can you confirm if you had “RewriteEngine On” twice in your .htaccess file or once? We will look for an alternative solution now and post it up shortly.

  16. Pasted this in my htaccess and now my wordpress dashboard is very slow to load anything.

    • Hey Ben, is it just when you’re logged in? Hows the site speed in general? This isn’t an issue we have had with the exact same code so if you give us more information we will look into it.

  17. I guess my comment was not approved for what reason I have no idea….
    The code slowed my website down to a painfully crawl. I removed the code and it runs normal again. Guess I will just ignore the views.

    • Hey Ben, you posted on a Friday so took a few days to review and approve your comment. Can you please do a test before & after having the code on this site: http://www.webpagetest.org/ and let me know the results plus what your site URL is and we will take a look. If you add filters to your Analytics you can remove the views without it interfering with your site speed.

  18. As these 4webmaster.org visits to my website are distorting my bounce rate and driving it through the roof as well as showing very short visit times of seconds does this mean google is now penalising my site in search engine rankings.
    I suupose its a great way to make us pay money to Google adwords!

  19. Thanks a lot for your article on how to block referrers. Unfortunately some of the referrer spam now don’t even bother to actually view your site. I recently tried to tackle the issue and ended up deciding on using a programmatic approach.

    Adding all these referrers under htaccess is slow and cumbersome for Apache to handle. You are better off blocking it directly in Apache itself, or filtering it out directly in Google analytics.

    Creating filters to exclude the referrers in Google Analytics was the solution for me. But as I needed a way to update thousands of sites at once, I used the API to do it. A full write up can be found here, https://blog.slowb.ro/beat-google-analytics-referrer-spam-programmatically/

    Also the tickbox “Exclude all hits from known Bots & Spiders” will never do anything for referrer spam due to, they are not bots or spiders. Bots are defined “Googlebot/2.1” and “YahooBot” which will never run any javascript on your page, and thus never show up in your analytics.

  20. The first block of code did indeed slow down our website, but the second block runs without any issues. Cheers.
    We’ve been seeing a lot of referrer spam for ages now and it’s very annoying indeed.

    • Hey Pam, I wouldn’t block that one in your htaccess as it may block legit traffic from hitting your site – you could still filter it from Analytics though.

  21. I understand linkedin.com, but I also get lnkd.in. Should I assume that’s spam? What about int.search.tb.ask.com ?

    Seems like I get new ones everyday! Thanks so much for the help!

  22. My website is pamelahaddix.com. All of a sudden I’m getting a referrer called pamelahaddix.us10.list-manage1.com. Is that something I should block? Seems odd. Thanks for answering all of these questions!

    • No, don’t block that. Its a link that has been put into an email sent from Mailchimp, either by you or someone featuring you in their newsletter/email campaign.

  23. Thanks for this great article on referrer spam. I applied mentioned technique but what should i do for organic spam for my website?

    • William John the best method is to create htaccess deny rules and olso GA filters for real crawler spam hits. There’s lot of information about in web bout it.

  24. Just got this referrer: translate.google.com.tw
    It also shows that it went to this page: 找不到網頁|崇拜和話語 which obviously doesn’t exist – unless that’s one of my pages written in Chinese? :-O
    But I’m assuming it’s all bogus, right?

  25. Thank you for this article. By reading it, i can block referrer spam to my blog from a spammy website that hotlinked my image. Once again, thank you very much, it’s very helpful for me.

Leave a Reply

Your email address will not be published. Required fields are marked *