很多用户想要修改WordPress文章ID,今天为大家介绍通过sql设置WordPress文章ID替换的方法,那么如何通过SQL数据库修改WordPress文章ID?

进入 mysql 命令或者 phpmyadmin 的 SQL,执行如下命令即可:如将文章ID为3368的文章修改为189。

update wp_posts set id = 3368 where id = 189;<br>

update wp_term_relationshi<a href=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\”https://www.wpzt.net/fw/photo.html\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\” target=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\”_blank\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\”>ps</a> set object_id = 3368 where object_id = 189;<br>

update wp_postmeta set post_id = 3368 where post_id = 189;<br>

update wp_comments set comment_post_ID = 3368 where comment_post_ID = 189;

如果是主题使用的是虚拟主机,可以使用以下代码:

UPDATE `wp_posts` SET `ID` = \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’189\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’,`guid` = <a href=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\”https://www.wpzt.net\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\”>www.wpzt.net</a> 189\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ WHERE `wp_posts`.`ID` =3368;<br>

UPDATE `wp_term_relationships` SET `object_id` = \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’189\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ WHERE `wp_term_relationships`.`object_id` =3368;<br>

UPDATE `wp_postmeta` SET `post_id` = \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’189\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ WHERE `wp_postmeta`.`post_id` =3368;<br>

UPDATE `wp_postmeta` SET `post_id` = \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’189\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ WHERE `wp_postmeta`.`post_id` = 3368;<br>

UPDATE `wp_comments` SET `comment_post_ID` = \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’189\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ WHERE `wp_comments`.`comment_post_ID` = 3368;

相关新闻

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

联系我们

联系我们

151-1101-0018

在线咨询:
邮件:30115776@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信
关注微信
分享本页
返回顶部