去评论
距米网-精简版

WordPress域名更换如何修改数据库

JUMU
2019/11/20 00:10:58
WordPress 博客域名更换
请在SQL运行下面代码,将前后域名链接更换成您想的即可。

  1. UPDATE wp_options SET option_value = REPLACE(option_value, 'https://www.jujumi.top', 'https://www.jujumi.com.cn') WHERE option_name = 'home' OR option_name = 'siteurl';

  2. UPDATE wp_posts SET post_content = REPLACE (post_content, 'https://www.jujumi.top', 'https://www.jujumi.com.cn');

  3. UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'https://www.jujumi.top','https://www.jujumi.com.cn');

  4. UPDATE wp_comments SET comment_content = REPLACE (comment_content, 'https://www.jujumi.top', 'https://www.jujumi.com.cn');

  5. UPDATE wp_comments SET comment_author_url = REPLACE (comment_author_url, 'https://www.jujumi.top','https://www.jujumi.com.cn');

  6. UPDATE wp_posts SET guid = REPLACE (guid, 'https://www.jujumi.top', 'https://www.jujumi.com.cn') WHERE post_type = 'attachment';