A simply way to block spam comments on WordPress (1)

Note: this solution just worked for half a day and was defeated. I worked out another solution: A simply way to block spam comments on WordPress (2)

Change the 20th line of the file wp-comments-post.php in the root folder: 

$comment_post_ID = isset($_POST[‘comment_post_ID’]) ? (int) $_POST[‘comment_post_ID’] : 0;
to:
$comment_post_ID = isset($_POST[‘comment_post_ID_iblog‘]) ? (int) $_POST[‘comment_post_ID_iblog‘] : 0;

 
Change the 1144th line of the file “wp-comments-post.php” under the “wp-includes
folder: 

$result  = “<input type=’hidden’ name=’comment_post_ID’ value=’$id’ id=’comment_post_ID’ />\n”;
to:
$result  = “<input type=’hidden’ name=’comment_post_ID_iblog‘ value=’$id’ id=’comment_post_ID’ />\n”;

One thought on “A simply way to block spam comments on WordPress (1)

Leave a Reply

Your email address will not be published. Required fields are marked *