Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

By default, the WP 'blacklist' feature finds comments containing the blacklisted string and moves them to the spam folder. What I am trying to do is change it so that instead of going to spam, the comment goes directly to the trash (or even better isn't stored at all).

In /wp-includes/comment.php around line 700:

if ( wp_blacklist_check($comment_author, $comment_author_email, $comment_author_url, $comment_content, $comment_author_IP, $comment_agent) )
    $approved = 'spam';
}

I tried modifying the line to $approved = 'trash'; but I am still getting comments containing blacklisted words being moved to my spam folder. The only comment related plugin I am running in Akismet, is it possible that Akismet is moving the comment to spam before comment.php processes it?

share|improve this question
    
I can't swear to it, but yes that is a plausible theory. –  s_ha_dum Feb 21 '13 at 5:25
    
@s_ha_dum The Akismet theory? I will try disabling it for a bit and see if there is any change. –  Josh Mountain Feb 21 '13 at 5:31
add comment

1 Answer

As I suspected originally, it would appear that Akismet is dealing with the comments before comment.php gets a chance, and thus they avoid the blacklist check entirely. After disabling Akismet the comments are moved to the trash as they should be.

share|improve this answer
    
There are a fair number of Akismet hooks that you may want to look into. –  s_ha_dum Feb 21 '13 at 14:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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