• Resolved Mayhem30

    (@mayhem30)


    In my functions.php file, I’m trying to preprocess comments before Akismet does. It doesn’t appear to be working.

    function comment_spam($commentdata) {
    $email_address = trim( strtolower($commentdata['comment_author_email']) );
    if ( $email_address == 'banned@home.com' ) {
    wp_die('Sorry, your email address has been banned from posting comments.', '', array('response' => 403));
    }
    }
    add_filter( 'preprocess_comment' , 'comment_spam', 1 );

    Looking at the plugin source code, it looks like Akismet also uses a priority of 1 on preprocess_comment filter – and is getting fired off before mine.

    What can I do to fix this?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Preprocess Comment before Akismet’ is closed to new replies.