当垃圾帖子上万之后,在WordPress后台删除显然就不现实了,于是直接执行SQL删除之:
DELETE FROM wp_posts WHERE post_status='pending'; # 删除所有待审核文章,因为bbpress是在post表里保存的帖子内容,所以此操作会删掉待审核的帖子 DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL; # 删掉孤立的帖子元信息 DELETE tr FROM wp_term_relationships tr LEFT JOIN wp_posts wp ON wp.ID = tr.object_id WHERE wp.ID IS NULL; # 删掉孤立的term绑定信息