禁止wordpress黑名单中的垃圾评论提交到数据库
大家知道wordpress黑名单的评论会被自动标记为垃圾评论, 这个做法我感觉挺浪费资源的, 毕竟垃圾评论还是写入了数据库, 如果集中时间段被大量spam攻击, 这种黑名单机制对保护数据库无济于事.
以下代码扔到functions.php:
function xhd_fuckspam($comment) {
if( is_user_logged_in()){ return $comment;} //登录用户无压力...
if( wp_blacklist_check($comment['comment_author'],$comment['comment_author_email'],$comment……