Wordpress comments exists in 4 states:
- 0 not approved
- 1 approved
- Trashed
- 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?
Wordpress comments exists in 4 states:
- 0 not approved
- 1 approved
- Trashed
- 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?
Share Improve this question asked Aug 1, 2020 at 22:09 BenjaminBenjamin 1656 bronze badges1 Answer
Reset to default 1I 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