如果您知道要删除的ID的顺序(例如从12001到23006)和YOU ARE SURE(!) 没有要保留的帖子,在要删除的第一个/最后一个ID之间有和ID。
示例:一个插件(例如站点地图插件)生成了大量帖子,如果您知道应该删除ID 12001和23006之间的所有帖子,您可以运行:
DELETE FROM wp_postmeta WHERE post_id in (SELECT ID FROM wp_posts WHERE ID BETWEEN 12001 AND 23006);
DELETE FROM wp_posts where ID BETWEEN 12001 AND 23006;