Change site URL and WordPress URL in Localhost

后端 未结 7 1212
温柔的废话
温柔的废话 2020-12-05 06:02

I am work in Wordpress. And my system localhost url is http://localhost:8080/wordpress.
I want to shift our site another system.

My problem is that my another sy

7条回答
  •  长情又很酷
    2020-12-05 06:38

    I use the following queries to update domain name of the site

    UPDATE wp_options
    SET option_value = 'http://new-domain-name.com'
    WHERE option_name = 'home';
    
    UPDATE wp_options
    SET option_value = 'http://new-domain-name.com'
    WHERE option_name = 'siteurl';
    
    UPDATE wp_posts
    SET post_content = REPLACE(post_content,'http://old-domain-name.com','http://new-domain-name.com');
    
    UPDATE wp_posts
    SET guid = REPLACE(guid,'http://old-domain-name.com','http://new-domain-name.com');
    

    Just change http://old-domain-name.com and http://new-domain-name.com to appropriate domain names. This should help you.

提交回复
热议问题