How to remove referrer spam from your website statistics

Referrer spam is a major annoyance for many webmasters. On this page, you'll learn how to remove referrer spam from your website statistics.

referrer spam

What is referrer spam?

Referrer spam happens when someone is making repeated website requests using a fake referer URL to the site the spammer wishes to advertise. In the website analytics of the spammed website, it looks as if the spammer is linking to the website although there is no real link. Referrer spam is done for two reasons:

  1. Websites that publish their access logs, including referer statistics, will inadvertently link back to the spammer's site. These links will be indexed by search engines as they crawl the access logs, which might have had a positive influence on the rankings of the spammer site in the past.

    With Google's Penguin anti-spam algorithm update, it is very unlikely that these links will help the spammer site today.
  2. Webmasters who check their statistics visit the website of the spammer to find out who is linking to them.

If your website statistics show a link to your website but you cannot find the link, then it is very likely that the 'link' is just referrer spam and not a real link.

How to block referrer spam

You can either block or filter referrer spam. If you filter the referrer spam in the Google Analytics interface, the spam still exists. For that reason, it is better to avoid referrer spam before it happens.

To block referrer spam, you have to adjust the .htaccess file of your website. Copy the text from the following box and paste it into the .htaccess file of your website. You usually find it in the public_html directory of your web server.

Be careful: Change the .htaccess file of your website at your own risk. Make a backup of the file before you change it. If you don't feel comfortable making these edits, ask your webmaster.

If you add the above to your .htaccess file, future sessions won't show the referrer spam. It won't affect the sessions that have already happened.

This will save you a lot of time

If you add the commands above to the .htaccess file of your website, you will save a lot of time because you don't have to check all of these fake referrers.

Continue with 'How to write profitable ads'.