• Upon analysing my spam, I have found that 100% of my spam comments enter a URL in the ‘Website’/’URL’ field.

    I have disabled the URL field from my website. So no HUMAN can see it.
    Spam robots can see it.

    So now I know with 100% certainty that any comment with the URL field populated must be spam. And so I want this to be sent to trash automatically.

    What would be the easiest and minimalist way to delete any comment which has the URL field populated?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Can you post an example of what you are talking about?

    I removed the url field too, but it did not stop the spam… This is what i did :

    in /wp-comments-post.php

    find :
    ——————————————————
    $comment_author = ( isset($_POST[‘author’]) ) ? trim(strip_tags($_POST[‘author’])) : null;
    $comment_author_email = ( isset($_POST[’email’]) ) ? trim($_POST[’email’]) : null;
    $comment_author_url = ( isset($_POST[‘url’]) ) ? trim($_POST[‘url’]) : null;
    $comment_content = ( isset($_POST[‘comment’]) ) ? trim($_POST[‘comment’]) : null;

    add after :
    —————————————–
    if (!empty($comment_author_url))
    wp_die( __(‘Sorry, no spam here…’) );

    ——————————————

    Normal posts will go through since $comment_author_url will always be empty but forged posts that contains url will return an error.

    This will also return a 500 error to the spam bot.

    Thread Starter PersonaGrated

    (@personagrated)

    Excellent! 😀

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to auto delete all comments containing URL field?’ is closed to new replies.