HomeDatabases

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

How to move your wordpress site to a new domain – easy wordpress migration
Like Tweet Pin it Share Share Email

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
@old-wp-url@ and @new-wp-url@ as per your website and run these query.

 

UPDATE wp_options SET option_value = REPLACE (option_value, “@old-wp-url@”, “@new-wp-url@”) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

 

UPDATE wp_posts SET guid = REPLACE (guid, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_posts SET post_content = REPLACE (post_content, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_posts SET post_content = REPLACE (post_content, CONCAT(‘src=”‘, “@old-wp-url@”), CONCAT(‘src=”‘, “@new-wp-url@”));

 

UPDATE wp_posts SET guid = REPLACE (guid, “@old-wp-url@”, “@new-wp-url@”) WHERE post_type = ‘attachment’;

 

UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_links SET link_url= REPLACE (link_url, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_links SET link_image = REPLACE (link_image, “@old-wp-url@”, “@new-wp-url@”);

 

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

If you still face any issue, post your comments.

Comments (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.