Stop Spam Referrer PHP Script Installation

Posted by Udegbunam Chukwudi on April - 7 - 2010

SPAM

Photo Credit: Mulad

Stop Spam Referrer PHP Script has joined the legion of anti-spam protection set up on my blog. It’s major function for me is to keep spammy referrers away from my blog.

Below is a capture of my AWSTATS Analytics showing my referrers. What is peculiar is that I can’t find a SINGLE LINK to my blog on most of these sites and that’s why they are SPAMMY REFERRERS.

Spammy Referrers

Installing this Google Codes php script is quite easy breezy ;) as you will come to see.



Download the Stop Spam Referrer PHP Script, extract and upload the referrer folder to the root of your wordpress installation.

Open the file wp-load.php which lies in the root of your wordpress installation and immediately after <? php on line 1 just add the code below:

/** Define BAD_REFERER */
define ( ‘BAD_REFERER_ACTIVE’, true);
if ( is_file( @dirname(__FILE__).’/referer/bad_referer.php’) ) if (is_file (@ dirname (__FILE__). ‘/referer/bad_referer.php’))
include_once( @dirname(__FILE__).’/referer/bad_referer.php’) ; include_once (@ dirname (__FILE__). ‘/referer/bad_referer.php’);

The file should now look like this:

 Stop Spam Referer PHP Script

Save the file and your done ;) .

Not to worry this php script doesn’t slow down your blog in any way as it’s in no way loaded to the database, doesn’t modify the .htaccess file and is very light!

Enjoy ;)


Related Articles You May Like To Read
  1. How To Drastically Reduce Spam Comments
  2. Anti-Spam Policy
  3. Rescue Non-Spam Comments With Conditional CAPTCHA
  4. How To Integrate Tweetmeme Without A Plug-in
  5. How To Secure WordPress Blogs Via Htaccess File

Disclosure: Please note that each time you make a purchase via any referral link on this site, I make a commission. Click here for more info.


9 Comments so far. Leave Yours Below

If you want to ask a question regarding anything from blogging to making money online and wordpress plugins tips, do please make use of the floating search bar at the bottom of this site. If you don't find what you're looking for, then feel free to ask your question

ALL COMMENTS WITH KEYWORDS AS NAMES WILL BE DELETED! TAKE NOTE!


Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.


  1. I don’t quite get the point. Since they are sending traffic your way, what is spammy about it. Except if there requesting for pingback! Please elaborate on this, I’m definitely interested, because I’ve been having similar referrers. Thanks
    .-= Nigerian Entrepreneur hopes you will read…How To Pacify Clients When You Fail To Deliver =-.

    • From the little I know, spammy referrers work by sending bots to your site and these bots in turn look for ways to leave spammy comments on you site. Don’t mistake their activities for traffic cos they ain’t. Hope this answers your question ;-)

  2. David says:

    Thank you for this post and for the instructions on how to use the PHP script. I found your post while doing a search on google trying to figure out why my stats where showing referrers from what looked like spam. My blog has been getting with spam referrers for a few days now and I thought I was going to insane thinking I had to live with that because I didn’t know what to do or even if there was a way to stop it. I have followed your instructions and I am hoping that this little trick works. My blog is only just over a month old and it’s been getting hit with spam left and right… they are killing me!! I have added a link to my post “how I fight spam” so that hopefully others will find you and these instructions and get the help they need with this problem also. I’ll try to remember to come back over here in a few days and let you know if this worked for me. Thanks again.

    • Thanks for the feedback man. I really appreciate it and I hope you are able to reduce your spam referrers with this script. Please note that it’s impossible to stop spam referrers totally but they can be reduced to the barest minimum.

      I also suggest you take a look @ Rescue Non-Spam Comments With Conditional CAPTCHA and Red Alert! Akismet Might Be Deleting Your Comments so as handle spam comments efficiently.

      Cheers man.

  3. I’m glad to see you’re using the new G.A.S.P. anti-spam test below. My continuing problem with comment spam is that somehow spammers are able to deactivate whatever antispam plugin I’m using. I have a suspicion that the Ozh menu plugin is the gateway, so I’m going to try deactivating it on some blogs and see if the problem goes away.

    • Udegbunam Chukwudi says:

      I had already written a glowing review of the plug-in when the spam started to stream in after I upgraded to version 1.01. The plugin is always activated but the spam just keep getting through. I’m combining it with Aksimet right now so as not to go crazy ;-)

  4. Norman says:

    Hi there, Love your site, some great tips here. I’m really new at this internet thing and have a question. My site, www.featuredcontentonline seems to have tanked in the last week, it seems all of my content is ranking quite bad now, where it used to be on page 1 or 2 on the serps. I’ve noticed two things, my page load speed has gone from about 5 seconds to over 12 seconds, and I’m also noticing links from sites but when I visit them I can’t actually find the link (like you described above). Will installing this scripts delete those links or just prevent new ones from showing up? In terms of site speed I installed w3 total cache as well as opened an Amazon cloudfront account. After installing and configuring it I’ve seen NO improvement in performance, does this take a few days to ‘kick in’? Thanks for your help, Norm

    • Udegbunam Chukwudi says:

      Thanks Norman. The invisible links pointing to your site have nothing to do with your search engine ranking, trust me. Of course that is if you are not linking back @ them. Installing this script won’t delete those links at all. With regards W3 Total Cache, you’re supposed to see immediate results but if you don’t, I suggest you check your configuration again.

      This post might help you: http://www.strictlyonlinebiz.com/blog/speed-up-wordpress-with-w3-total-cache/1231/

      Holla of you still need help ;-)