WordPress更换域名的批量SQL

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

文章原始链接:https://sijie.wang/posts/wordpress-replace-domain

本站文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请保留原始链接