My SQL queries for word-press website move on another host

  • My SQL queries for word-press website move on another host

    My SQL queries for word-press website move on another host

    After migrating a WordPress site to a new URL either live or to a production or development server, the new URL strings in the mysql database need to be changed and updated in the various mysql database tables.

     

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
    
    UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
    
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

     

    It's only fair to share...Share on Google+Pin on PinterestTweet about this on TwitterShare on Facebook

    Comments are closed.