A very easy way to block spam comments in WordPress without plugin – remove “website” field

Posted by NosaLee in WordPress Experience on 14-06-2011.

Author: Nosa Lee
Original Address: http://www.seeksunslowly.com/wordpress-spam-comments-website
To reprint this article, please indicate the source, thank you.

As you know, WordPress blog very easily become a spammer’s farm.
But I do not want to close the comment due to this is blog, if no comment, it is no longer a real blog.

So, I tried some plugins to antispam, but I can not find a simple and perfect plugin.

I think, I must do it myself.

Through observation, I found that the most of spam comments are posted by spammers (programs, not humans), and they will leave the websites.

So, why do not remove the [Website] field from the comment form? This way is very simple and perfect without plugin!
Through research, I found you can remove the [Website] field from the comment form by the following way:
Remove the following code from wp-includes/comment-template.php:

'url'    => '<p class="comment-form-url"><label for="url">' .
             __( 'Website' ) . '</label>' .
             '<input id="url" name="url" type="text" value="' .
             esc_attr( $commenter['comment_author_url'] ) .
             '" size="30" /></p>',

I tested this change, it works fine.

Another thing, Although you have blocked the most spam comments, but you still need to turn on “An administrator must always approve the comment” option to ensure no spam comments on your WordPress blog.

Post a comment