修改WordPress域名

比如,我需要把域名dm01.neohope.org换为dm02.neohope.org,需要进行以下操作:

1、如果需要,可以重命名wordpress文件夹

2、如果需要,修改wordpress的数据库设置

3、更新wordpress主配置

UPDATE wp_options SET option_value = replace( option_value, 'dm01.neohope.org', 'dm02.neohope.org' ) WHERE option_name = 'home' OR option_name = 'siteurl';  

4、更新posts

UPDATE wp_posts SET post_content = replace( post_content, 'dm01.neohope.org', 'dm02.neohope.org' ) ;  
UPDATE wp_posts SET guid = replace( guid, 'dm01.neohope.org', 'dm02.neohope.org' ) ;  

5、更新comments

UPDATE wp_comments SET comment_content = replace(comment_content, 'dm01.neohope.org', 'dm02.neohope.org') ;
UPDATE wp_comments SET comment_author_url = replace(comment_author_url, 'dm01.neohope.org', 'dm02.neohope.org')

6、搞定

Comments are closed.