如果您只是计划更改域名,同时保留在同一台服务器上,那么您所要做的就是在WP DB上运行此查询。。确保您的旧url和新url没有尾部斜杠,并始终在进行任何更改之前备份数据库!
UPDATE wp_options SET option_value = replace(option_value, \'http://www.oldurl\', \'http://www.newurl\') WHERE option_name = \'home\' OR option_name = \'siteurl\';
UPDATE wp_posts SET guid = replace(guid, \'http://www.oldurl\',\'http://www.newurl\');
UPDATE wp_posts SET post_content = replace(post_content, \'http://www.oldurl\', \'http://www.newurl\');
UPDATE wp_postmeta SET meta_value = replace(meta_value,\'http://www.oldurl\',\'http://www.newurl\');