最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Make every comment go to the spam folder

programmeradmin0浏览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?

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?

Share Improve this question asked Aug 1, 2020 at 22:09 BenjaminBenjamin 1656 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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

发布评论

评论列表(0)

  1. 暂无评论