用WordPress做采集站的朋友,遇到最大的问题就是文章会重复,这时,我们就需要将重复的文章进行去重处理,如何能方便快捷的一次性删除WordPress重复标题的文章呢?下面站长就给大家介绍两种一次性去除标题重复文章方法:
使用方法:
只需将下面的SQL语句,放到自己网站数据库的 SQL框里,然后执行就可以了。
1、去除重复文章,只保留一篇
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、去除重复文章,一片都不保留
CREATE TABLE my_tmp AS Select ID AS col1 From wp_posts Where post_title In (Select post_title From wp_posts Group By post_title Having Count(*)>2); DELETE FROM wp_posts WHERE ID IN (SELECT col1 FROM my_tmp); DROP TABLE my_tmp;
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容