WordPress换域名需要替换数据库

2023-07-15
1,226次阅读
没有评论

更换域名后,需要把原来域名替换成新的域名,还有最后把旧域名做301跳转到新域名

UPDATE wp_options SET option_value = replace(option_value, 'https://old.com', 'https://www.new.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://old.com','https://www.new.com');
UPDATE wp_posts SET post_content = replace(post_content, 'https://old.com', 'https://www.new.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://old.com','https://www.new.com');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'https://old.com', 'https://www.new.com');
UPDATE wp_comments SET comment_content = REPLACE (comment_content, 'https://old.com', 'https://www.new.com');
UPDATE wp_comments SET comment_author_url = REPLACE (comment_author_url, 'https://old.com','https://www.new.com');

粘贴进去,右下角执行即可

WordPress换域名需要替换数据库

正文完
要饭中,多少给点吧(支付宝)
post-qrcode
 0
评论(没有评论)
验证码