WordPress如何批量删除某个分类下文章?

首先查询一下,其中47为分类ID,看查询结果是否和实际结果符合

1
SELECT * FROM `wp_posts`,`wp_term_relationships` WHERE wp_posts.ID = wp_term_relationships.object_id AND wp_term_relationships.term_taxonomy_id = 47;

然后就可以使用delete语句了,注意,这是sql操作语句,操作前最好备份数据库!

1
DELETE `wp_posts` FROM `wp_posts`, `wp_term_relationships` WHERE wp_posts.ID = wp_term_relationships.object_id AND wp_term_relationships.term_taxonomy_id = 47

再次提醒,执行删除语句前 请先备份数据,后果自负!

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: