WordPress更换域名别忘了更改数据库!

WordPress更换域名别忘了更改数据库!

//1.站点和主页地址
UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’,
‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

//2.博客文章链接
UPDATE wp_posts SET guid = replace(guid, ‘http://www.old-domain.com’,
‘http://www.new-domain.com’);

//3.文章中链接附件
UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.old-domain.com’,
‘http://www.new-domain.com’);

//4.评论的昵称和邮箱
UPDATE wp_comments SET comment_author_email = REPLACE(comment_author_email, ‘old@email’,
‘new@email’);
UPDATE wp_comments SET comment_author = REPLACE(comment_author, ‘old_name’,'new_name’);

以上语句在phpmyadmin執行!!!

标签:

声明: 本站wordpress主题均为原创转载请注明出处,本文固定地址:http://www.92off.com/wordpress-change-database.html