How to move your wordpress site to a new domain – easy wordpress migration

WordPress stores the URL in his database, one of my colleague is new bie for WordPress.He has developed a new WordPress site and client has given all the data to him.After making the full site ready, he get stuck that four most important tables have URL in it, so should all the data need to re-enter by WordPress admin.

 

I know most of the WordPress newbie think like this, but it can be done by below eight very simple queries (in the case if you have not installed any large plugins)

 

What you need to done is just replace
@[email protected] and @[email protected] as per your website and run these query.

 

UPDATE wp_options SET option_value = REPLACE (option_value, “@[email protected]”, “@[email protected]”) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

 

UPDATE wp_posts SET guid = REPLACE (guid, “@[email protected]”, “@[email protected]”);

 

UPDATE wp_posts SET post_content = REPLACE (post_content, “@[email protected]”, “@[email protected]”);

 

UPDATE wp_posts SET post_content = REPLACE (post_content, CONCAT(‘src=”‘, “@[email protected]”), CONCAT(‘src=”‘, “@[email protected]”));

 

UPDATE wp_posts SET guid = REPLACE (guid, “@[email protected]”, “@[email protected]”) WHERE post_type = ‘attachment’;

 

UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, “@[email protected]”, “@[email protected]”);

 

UPDATE wp_links SET link_url= REPLACE (link_url, “@[email protected]”, “@[email protected]”);

 

UPDATE wp_links SET link_image = REPLACE (link_image, “@[email protected]”, “@[email protected]”);

 

Now move your WordPress site to a new domain is very simple, isn’t it!!

If you still face any issue, post your comments.

One thought on “How to move your wordpress site to a new domain – easy wordpress migration”

  1. This is a very inspiring article. I am truly impressed
    when reading your posts. You produce very helpful stuff.

    Keep it up. Keep blogging. looking forward to seeing your next article.

Comments are closed.