提示:以下方法适用于Akismet Version 3.0.0版本(老版本建议直接升级到最新,最新版防御垃圾评论效果更好)


2、找到“Akismet”这个插件的akismet/class.akismet.php (akismet/akismet.php)文件,然后找到如下的代码:

while( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 ) ) ) {

其中INTERVAL 15 DAY中的15换成你自己想要的天数就可以了,例如INTERVAL 1 DAY等等。

3、再在WordPress后台控制面板里面找到“设置”菜单找到“Akismet”,在“Akismet”插件的设置选项中,将“Strictness”这里选择为“Always put spam in the Spam folder for review.(Note: Spam in the spam folder older than 15 days is deleted automatically.)”(也就是勾选超过15天的垃圾邮件文件夹被自动删除。)

This entry was posted in Technology and tagged , , , , . Bookmark the permalink. 6,012 views

Related Posts

2 Responses to WordPress中Akismet修改自动删除spam垃圾留言评论的时间

  1. 新奇趣 says:


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>