Skip to main content
Articles

Blocking Spam Google Referring Traffic Links With HTACCESS

I have clients that get a lot of form spam directly from google ads. Basically, someone highjacks a legitimate Google Ads link for say, a car dealer or a dental practice, and does their own ad in a foreign country for “make $25-$50 dollars working remote for a company in the US” and reuses the same random form (yours). They get a click, and we get a random REAL form fill from non-english speaking people thinking they are filling out a job application or to get something sent to them for free. It’s super annoying, and google is aware of it.

Because it’s also REAL traffic and REAL form fills, it’s hard to block with re-captcha and other security measures. Luckily, in Google analytics, SharpSpring, and HubSpot you can pretty much see all the referring sites. Below is a little snippet of code to throw in your .htaccess file to block that referring spam ad traffic.

Note: This is not a set it and forget it. You’d have to revisit this file every 30 days and adjust for a bit until the form fill traffic drops off. You’re still going to get the referring traffic reported in Google Analytics so you” have to filter reports with a Referral Exclusion List. A good example on how to do that is here.

TLDR;
Add your spam referral traffic links below and add this module to your .htaccess file.



<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# block spammers - duplicate a line if you need more
RewriteCond %{HTTP_REFERER} store.sample-link.com [NC,OR]
RewriteCond %{HTTP_REFERER} link.sample-link [NC,OR]
RewriteCond %{HTTP_REFERER} static.sample-link.website [NC,OR]

# This needs to stay
RewriteRule .* - [F]

</IfModule>