wordpress更换域名
干净的替换掉老域名需要如下三条sql查询语句:
```
UPDATE wp_options SET option_value = REPLACE(option_value,'old domain','new domain') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET post_content = REPLACE(post_content,'old domain','new domain'); UPDATE wp_posts SET guid = REPLACE(guid,'old domain','new domain'); ```
<span id="more-1761"></span>
另外,直接拷贝以上三行执行sql语句时,别忘记确认下’单引号,可能拷贝下来的会出错,中文格式的单引号是不能正常执行的。。
以上三条是替换数据库中涉及的所有老域名。
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/changedomain/820.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.