Simple CommentSpam hack?
-
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?
The topic ‘Simple CommentSpam hack?’ is closed to new replies.