I removed url field from my comments so there is just basically name, email and textarea field. But spammers are keeping spamming me with comments that has URLS even if comments form doesnt have any + plus it has recaptcha + akismet.

So probably they are going directly to my website to spam their comments (or I dont know how to say it) so my solution that I was thinking about is 1) If comment has url > automatically spam folder 2) Remove url field from core

What do you think ?

  • Add a security question or captcha to fight the spam. Just because the URL field is not there doesn't mean that it can't be easily added because the URL field is processed in the core function that deals with the comment form. – Christine Cooper Sep 13 '15 at 12:10
  • yes there is recaptcha, but it can be easily solved by recaptcha solving services ..so I am asking if there is way to remove url field from core or if they submit comment with link to automatically add it to spam – Chymmi Sep 13 '15 at 16:04
  • I don't think automatically sending them into spam would help. You're most likely miss out on a genuine comment where sending a link was important. (if not now, maybe in future). A] You can hold all comments for moderation & manually approve. Remove which don't make into Approved list B] Use Disqus commenting system where, you can set to hold all comments if they contain links (+ comments on it, doesn't show website field) – tushonline Sep 13 '15 at 20:31
  • yes all comments are in moderation, but if you got like 20.000 comments per day, well it is not easy to clean up. I will also never allow to use links in my comments, because it is not blog actually. – Chymmi Sep 13 '15 at 20:37

The decision about comment status upon posting is made by wp_allow_comment() function.

There is a filter in it that can be used to change it accordingly. Basic form would look something like this (not tested):

add_filter( 'pre_comment_approved', function( $approved, $commentdata ) {

    if ( ! empty( $commentdata['comment_author_url'] ) ) {
        return 'spam';

    return $approved;
}, 10, 2 );

This probably needs to be refined though, since it will probably interfere with users registered on site, who have URL set in profile.

  • there are no users registered :) anyway what means "return 'spam';" ? that comments with comment_author_url will go to spam folder ? Thank you very much Rarst! – Chymmi Sep 13 '15 at 16:47
  • Yes, there are three possible values there: 1 (approved), 0 (not approved), and spam. Still needs testing though, just wrote after quick look at code. – Rarst Sep 13 '15 at 16:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.