WordPress换域名后mysql批量替换旧域名

闲聊 无标签
1 887
WIZ
WIZ 自成一派 2022-11-11 21:25:40
Lv:37级
我们购买的虚拟主机或安装有宝塔面板的服务器都有phpMyAdmin,我们可以通过phpMyAdmin进入到数据库,

然后通过以下SQL语句来替换新旧域名:

UPDATE wp_options SET option_value = replace(option_value,'old.com','new.com');
UPDATE wp_posts SET post_content = replace(post_content,'old.com','new.com');
UPDATE wp_posts SET guid = replace(guid,'old.com','new.com');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt,'old.com','new.com');
UPDATE wp_comments SET comment_author_url = replace(comment_author_url,'old.com','new.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'old.com','new.com');

楼主签名:DNSWIZ 站长故事
回帖
回复列表