1、使用插件Delete Duplicate Posts
2、使用mysql管理工具执行下面的sql语句
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;
3、写一个PHP文件,取名delete.php。上传至网站根目录,打开浏览器运行http://www.域名/delete.php
代码如下:
<?php
require(‘./wp-load.php’);
$strsql = “create table my_tmp as select min(ID) as col1 from wp_posts group by post_title”;
$strsql1 = “delete from wp_posts where ID not in (select col1 from my_tmp)”;
$strsql2 = “drop table my_tmp”;
$result = mysql_query($strsql);
$result = mysql_query($strsql1);
$result = mysql_query($strsql2);
?>
注意:按照以上方法执行,可能会出现菜单不显示。检查发现进入wordpress后台,点击文章-》分类目录,重新编辑所有分类目录,然后去外观-》菜单,重新编辑菜单即可。
新闻热点
疑难解答