通过SQL修改wordpress文章id的方法

摘要:修改wordpress文章id在正常使用中应用场景并不多,简单大挖简单讲一下通过sql设置wordpress文章id替换…

修改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=”/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;

1 2 3 4 update wp_posts set id = 3368 where id = 189 ; < br > update wp_term_relationshi < a href = “/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=”http://www.111cn.net”>www.111cn.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;

1 2 3 4 5 UPDATE wp_posts SET ID = ‘189’ , guid = < a href = “http://www.111cn.net” > www . 111cn.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 ;
 收藏 (0) 打赏

您可以选择一种方式赞助本站

支付宝赞助

微信钱包赞助

版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!:ABC资源站 » 通过SQL修改wordpress文章id的方法

切换注册

登录

忘记密码 ?

切换登录

注册