If your Blog is made on WordPress platform and you want to change the location/ URL of the Blog, which may be due to reasons like: your have built the site on your system locally using the localhost in your URL; or your blog is already hosted with different domain name and now you want to host it with some other domain name, this article may be of some use to you fellows. Just follow the few simple steps mentioned below.
- First of all logon to your Blog’s database through PhpMyAdmin control.
- Then select your Blog’s database. You will find 15-16 tables under it using the prefix “wp_”.
- Now you need to pass some queries for some of the tables; to be precise you need to pass some queries for three tables which are mentioned below:
First update wp_options table:
To update WordPress options with the new blog location, first select the wp_options table on the left panel. Then select “SQL” on the right panel and pass the below mentioned query in the textbox for the query and click go to pass the query.
your old domain will be http://localhost/your_blog if you have built the site locally on your system.
Second update wp_posts table: This will fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs, so we need to change them with the following SQL query:
Lastly update wp_posts table: This will fix the URL links which you have used to link posts or pages internally within the posts you have published, which we will change using the following SQL query:
Now re-login to your wp-administration to update the cookies and also check your blog and post if they are working properly.