WordPress修改文章ID的方法

PhpMyAdmin –> SQL ,在数据库 pop 运行 SQL 查询:

将ID为3368的文章修改为189

update wp_posts set id = 3368 where id = 189;
update wp_term_relationships set object_id = 3368 where object_id = 189;
update wp_postmeta set post_id = 3368 where post_id = 189;
update wp_comments set comment_post_ID = 3368 where comment_post_ID = 189;

将ID为189的文章修改为3368

UPDATE `wp_posts` SET `ID` = '189',`guid` = 'http://429006.com/?p=189' WHERE `wp_posts`.`ID` =3368;
UPDATE `wp_term_relationships` SET `object_id` = '189' WHERE `wp_term_relationships`.`object_id` =3368;
UPDATE `wp_postmeta` SET `post_id` = '189' WHERE `wp_postmeta`.`post_id` =3368;
UPDATE `wp_postmeta` SET `post_id` = '189' WHERE `wp_postmeta`.`post_id` = 3368;
UPDATE `wp_comments` SET `comment_post_ID` = '189' WHERE `wp_comments`.`comment_post_ID` = 3368;

两种方法都行,上面是Pop在网上搜集,下面的是Pop手动修改MySQL得到的代码。

This entry was posted in Technology and tagged , , , . Bookmark the permalink. 2,462 views

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>