wordpress SQL删除某个分类下的所有文章

对数据库进行sql操作前,请先对数据库进行备份,备份参见https://xiaohost.com/1202.html

先检查下数据是否一致,将以下命令中的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 = 128;

然后进行删除

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 = 128
原文链接:https://xiaohost.com/2624.html,转载请注明出处。
0

评论0

请先