有一个朋友的wordpress被入侵了,某分类下被发了大量的垃圾广告文章,大概有七八千篇,一个一个删除,实在太麻烦了,求助于我,有什么快的办法吗,其实我们可以通过SQL命令,一键删除某个分类的所有文章。
SQL命令如下 执行前,记得一定要备份数据,数据无价。
delete from wp_posts using wp_posts, wp_term_relationships, wp_term_taxonomy where wp_posts.id = wp_term_relationships.object_id and wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id and wp_term_relationships.term_taxonomy_id = 0(0替换为你要删除的分类ID) 如果你的站点是多站点 可以用以下代码
delete
from
wp_2_posts
using
wp_2_posts,
wp_2_term_relationships,
wp_2_term_taxonomy
where
wp_2_posts.id = wp_2_term_relationships.object_id
and
wp_2_term_relationships.term_taxonomy_id = wp_2_term_taxonomy.term_taxonomy_id
and
wp_2_term_relationships.term_taxonomy_id = 0(0替换为你要删除的分类ID)
//其中以上wp_2为对应站点的表前缀
每日壁纸