0

Wordpress comments exists in 4 states:

  1. 0 not approved
  2. 1 approved
  3. Trashed
  4. Spam

When a user makes a comment it will end up in the 0 not approved folder, or if it's a spam comment directly to the spam folder.

Is it possible to send every single comment to the spam folder?

1 Answer 1

1

I don't know of a way the default comment status can be changed, but there's an action 'comment_post' that runs after comments are inserted that you could easily hook to set every new comment to have the 'spam' status:

function set_new_comment_to_spam($commentId) {
    wp_set_comment_status($commentId, 'spam');
}

add_action('comment_post', 'set_new_comment_to_spam', 10, 1);

Add that to your functions.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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