Moving wordpress websites from one domain to another
Today, I am going to write a post on how you can move your WordPress websites from one domain to another domain. Or say how you can upload your website you have developed in your local webserver i.e. http://localhost/website/ to http://www.website.com/. In this post, I am going to cover the basic steps that you need to move a website to a new domain.
First of all move all the files to the root web directory of the new domain. Import the database into your new webhosting.
0. Change wp-config.php file with the database username, database password, databasee name
Now its time to run some sql statements:
1. Update the home url
update wp_options set option_value=replace(option_value,'http://localhost/website,'http://www.website.com') WHERE option_name='home' OR option_name='siteurl'
2. Update the URLs of all WordPress posts
update wp_posts SET guid=replace(guid,'http://localhost/website','http://www.website.com');
3. Update links in contents of a post
update wp_posts set post_content=replace(post_content,'http://localhost/website',http://www.website.com');
Comments
Post a Comment