Latest News:

 

HowTo Eliminate Wordpress Trackback Comment And Pingback Spam!

Have you ever gone to your Akismet plug-in in Wordpress and NOT had spam to clear out? Even seeing it there can be depressing and a strain on your servers resources. Why even let spam bots eat up your processor with extra SQL queries! I’ve come up with a spam defense lineup where 99% of my spam stops bots before they even get logged as spam!

Defense Line 1: Number CAPTCHA
//FILE: /wp-content/themes/YOURTHEME/comments.php - where YOURTHEME is the name of the theme you’re currently using
//FIND:
//AFTER any closing tags for your paragraphs or label setup, add:
function numbercapcha() {
$firstnum = rand(5,8);
$secondnum = rand(1,4);
$coinflip = rand(1,2) % 2;
if($coinflip == 0) {
$math = $firstnum + $secondnum;
$operators = array("+","Added To","Plus");
$operatorschoice = rand(1,3) % 3;
} else {
$math = $firstnum - $secondnum;
$operators = array("-","Minus");
$operatorschoice = rand(1,2) % 2;
}

echo $firstnum . " " . $operators[$operatorschoice] . " " . $secondnum . " = ";
return $math;
}
// Contiue with your theme and use this snippit of PHP to generate the input field:
//
// Example usage shown below:
?>




//FILE: /wp-comments-post.php (in the root directory)
//FIND: $comment_type = ”;
//This should be on like 63 in Wordpress 2.6
//AFTER ADD:

if ( is_numeric($numcheck) && $sessioncapcha == $numcheck ) {
//This should be left blank unless you want to do something else if the number was answered correctly
} else {
//Number wasnt answered correctly - Show Error
wp_die( __(‘Error: You did not answer the security question correctly.’) );
}
?>
Download this code: 0810wordpresscommentcapcha.txt

Digg It! Add to del.icio.us Stumble This

Posted in Labels: |

0 comments: