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:
if ($_POST[‘yanzhengma’] == ‘919191’) {
$comment_post_ID = isset($_POST[‘comment_post_ID’]) ? (int) $_POST[‘comment_post_ID_iblog’] : 0;
}
Below the 1548th line ” <?php echo $args[‘comment_notes_after’]; ?> ” of the file “ wp-comment-template.php ” under the “ wp-includes ” folder, add this line:
<p>Put “919191” here, then click “Post Comment” button to submit.
<input type=’text’ name=’yanzhengma’ id=’yanzhengma’ /></p>
Pingback: A simply way to block spam comments on WordPress (1) | Mia's Blog
This solution works great so far. My blog has got none of spams since then. 🙂