dongqun1656 2014-07-23 16:06
浏览 38
已采纳

是否有任何简单的方法可以在网站迁移后更新wordpress帖子或页面中的媒体或页面链接

I have a wordpress website, that i just completed customisation within my localhost. Where i set permlinks http://localhost/nwp as my siteurl and home url. And in my website i used links inside my pages and posts for referring images,videos and other pages and posts. When i migrate this website into my live server i changed my site url and home url to http://mydomain.com. but the url i pasted inside pages and posts still exists as old like http://localhost/nwp/uploads/2014/img.jpg ,http://localhost/nwp/your-page etc.. I can fix this issue by opening all pages or posts and replacing those old links inside pages or posts with new links .But it take too much time. i didn't know any other method to solve this problem easily.Please help me If any one know a better method to fix this issue easily

  • 写回答

2条回答 默认 最新

  • dtq26360 2014-07-23 17:23
    关注

    Thank you all for your Answers. But I just found a secure and easy way without any help of additional download script. we need to execute sql UPDATE query to update all contents in database as below.

    mysql> UPDATE wp_posts SET guid = replace(guid, 'http://localhost/nwp','http://mydomain.com');
    
    mysql> UPDATE wp_posts SET post_content = replace(post_content, 'http://localhost/nwp', 'http://mydomain.com');
    
    mysql> UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://localhost/nwp','http://mydomain.com');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大