Simple CommentSpam hack? (2 posts)

  1. LennartF
    Posted 10 years ago #

    In the WordPress Admin GUI: Options/Discussions are two Comment Moderation filters: Number of URLs allowed in a comment and a list of forbidden words.
    In the functions.php file is the function check_comment which matches against 'comment_max_links' and the forbidden words, called 'moderation_keys'. (Ought to be called 'forbidden_words')

    If I after the line: $word = trim($word); add the line $word=strtolower($word); I don't have to worry about upper and lower casing the forbidden words.

    Then: If check_comment returns false we set the variable $aproved=1.
    If I under this line add the new line: die( __('Spam word encountered. Comment not allowed') );

    Would I not make the default WordPress spamguard stronger and allow it to simply discard all comments flagged before they reach the moderation queues in the comment table?

  2. DarkCryst
    Posted 10 years ago #

    an interesting point... at first thought it makes sense... something is niggling at my mind about it tho.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.