比较有意思的方法:通过 SQL 命令删除
如果你不喜欢折腾插件,并且你可以通过登陆PhpMyAdmin 管理MySQL数据库,那你可以通过 SQL 命令来删除
Wordpress评论表为wo_comments,comment_approved为评论回应的字段.
Comment_approved 为1 :通过审核的评论
Comment_approved 为0:待审核的评论
Comment_approved 为trash:回收站的评论
Comment_approved 为spam: 垃圾评论
use wordpress;
#其中0表示未审核的评论 待审评论
DELETE FROM wp_comments WHERE comment_approved = '0';
#其中的‘1’,表示的是所有评论;
DELETE FROM wp_comments WHERE comment_approved = '1';
DELETE FROM wp_comments WHERE comment_approved NOT LIKE '1';
#删除垃圾评论
DELETE FROM wp_comments WHERE comment_approved = 'spam';
#删除回收站评论
DELETE FROM wp_comments WHERE comment_approved = 'trash';
#-e 删除所有评论
mysql -uroot -p123456 -e "use wordpress; DELETE FROM wp_comments WHERE comment_approved = '0'; DELETE FROM wp_comments WHERE comment_approved = '1'; DELETE FROM wp_comments WHERE comment_approved NOT LIKE '1'; DELETE FROM wp_comments WHERE comment_approved = 'spam'; DELETE FROM wp_comments WHERE comment_approved = 'trash'; "