Header Ads

How to change your Wordpress Domain name or directory using phpMyAdmin


Let us learn

How to change the wordpress domain


This How to guide assumes that you have already moved all the files of your website to the new domain activated hosting account or simply to a new directory.For example, to the new hosting account installed on "www.newdomain.com" or to "www.newdomain.com/blog".

If you have already changed the domain of your hosting account just simply follow this guide.We are using one of the classic tools of the phpMyAdmin in-order to do the necessary modifications in our database tables.These three simple steps can do the magic.

  1st we need to update the WP-options parameter it is the part were the WP engine gets connected to the domain name of our website, it is the most important part of the three.Go to   php myAdmin and select the database which you have the wordpress tables.go to the query section and run this query by modifying  "http://www.old-domain.com" with your old domain name and "http://www.new-domain.com" with the new domain name.

 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'; 



2nd step is to update the URL'S of the posts,categories archive and other site domain related URL'S, For this run this SQL query with modification for domain as mentioned in the first step.



UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com'); 

  3rd step is to update the urls of the internally linked content to work properly such as images videos links etc.Don't forget to give the necessary modifications as said in the first step.


UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); 

Now we are Done and our site is online and ready for the visitors from "http://www.new-domain.com"
Powered by Blogger.