Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 04:31 pm EDT

Referrer Spam & Visitor Stats Plugin

  • Thursday, April 21 2005 @ 03:19 pm EDT
  • Contributed by:
  • Views: 19,479
Spam Hi, this is just a short note about referrer spam and the problem I've had with it and the Visitor Stats plugin by Tom Willet and John Huges, I believe... My site, www.justrage.com gets loads and loads of referrer spam for some obscure reason, and I've always had a hard time doing htaccess magic. So here's what I do and it works for me.

Assuming, of course, you have the Visitor Stats plugin, go to your /plugins/stats directory, open functions.inc and find the following line:

if ($host == 'geeklog.sourceforge.net') {
  $host = 'geeklog.sf.net';
}
And then add the following new line under it:

if (ereg("word", $host)) {
  $host = '';
}
// the '' are single quotes, not a double quote
Change "word" to a specific string in the referring URL you want to block. For instance if you want to block http://something.ne.com you chould change "word" to "something" or "ne" or "com" or even "ne.com". What happens is that the code will simply rub out ALL the referring urls that contain "word" anywhere in it. It will only rub out the URL from the Stats phpblock, though, not the stats pages themselves. Which works fine for me anyway.

Add as many lines under it for as many "words" you need to block.

To my knowledge and experience, SpamX only blocks comment spam, and htaccess is just too complicated for me. So this is what I simply do to resolve my referrer spam issues. Hopefully, in the future someone could update the Stats plugin to include an easy way of doing it from its admin frontend.