在迁移Wordpress数据的过程中(或者采集过程中),可能会遇到这种问题:同样一篇文章被导入了2次或者3次,这时候就要删除重复的文章了。
SQL语句删除
在Mysql中执行:
CREATE TABLE my_tmp AS SELECT MIN(ID) AS col1 FROM wp_posts GROUP BY post_title;
DELETE FROM wp_posts WHERE ID NOT IN (SELECT col1 FROM my_tmp);
DROP TABLE my_tmp;
2.使用插件Delete Duplicate Posts