SQL 查找和替换文本
我正在努力更新现有的 WordPress 数据库,一切进展顺利。然而,链接仍然指向旧网站。有没有办法使用循环或其他东西来运行每条记录并更新 http://OLD_URL.com 来表示 < a href="http://NEW_URL.com" rel="nofollow">http://NEW_URL.com?
我可能只是懒得手动做,但如果归根结底我会的。谢谢。
I'm working on updating an existing wordpress database and everything is going smoothly. However, the links are still directing to the old site. Is there any way to use a loop or something to run through every record and update http://OLD_URL.com to say http://NEW_URL.com?
I might just be too lazy to manually do it but I will if it comes down to it. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通常在 phpmyadmin 中运行几个快速命令,然后就完成了。这是讨论这个确切问题的博客文章: http://www.barrywise.com/2009/02/global-find-and-replace-in-wordpress-using-mysql/ 我会先读这个:http://codex.wordpress.org/Changing_The_Site_URL 确保首先覆盖您的所有基础。
I usually run a couple of quick commands in phpmyadmin and I'm done. Here's a blog post that discusses this exact issue: http://www.barrywise.com/2009/02/global-find-and-replace-in-wordpress-using-mysql/ I would read this first: http://codex.wordpress.org/Changing_The_Site_URL to make sure all your bases are covered first.
如果您想更新特定表中的链接,可以使用如下查询:
If you want to update links in a particular table you can use the query like below: