Repel those mosquito robots and spammers!

Version: 13.1
Revision: 13 Build 16

Repel those mosquito robots and spammers!

Introduction:
last night, I was totally ‘brain-dead’ and I am not in a mood, just to write another article. So, to keep my readers and guest happy, I have to keep going and push my knowledge to the edge!

Here is another article for you to filter / block more SPAM, Robots and Comment Junkies (spammers that post the same sentence and acts like robots). However, this code will only work, if you are using “PHP scripting engine” or WordPress.

Notes: if you want to use this source, just to reduce SPAM and other Robots, I would recommend you to make a backup of your ‘Theme’ folder and your SQL database. After that, you can continue with the tutorial.

1.] Login to your Cpanel and direct yourself to your ‘Theme’ folder.

2.] Look for this file: ‘function.php’ and add this code into the file.

function check_referrer() {
    if (!isset($_SERVER['HTTP_REFERER']) || $_SERVER['HTTP_REFERER'] == "") {
        wp_die( __('Get away from my blog and stop spamming!') );
    }
}
add_action('check_comment_flood', 'check_referrer');

3.] Save your changes and let those crazy spammers deal with their own problem!

4.] You’re done!

Copyrighted By Lair360

Comments are closed.