wordpress删除各种类型评论的sql语句

//删除待审评论、垃圾主论,回收站评论
DELETE FROM `wp_comments` WHERE `comment_approved` NOT LIKE '1';

//只删除待审评论
DELETE FROM `wp_comments` WHERE `comment_approved` = '0';

//只删除垃圾评论
DELETE FROM `wp_comments` WHERE `comment_approved` = 'spam';


//只删除回收站评论
DELETE FROM `wp_comments` WHERE `comment_approved` = 'trash';

comment_approved 等于1:通过审核的评论
comment_approved 等于0:待审核的评论
comment_approved 等于trash: 回收站的评论
comment_approved 等于spam : 垃圾评论

你可能感兴趣的:(wordpress,php,mysql)