Archive for the tag 'sql'

You must remember that there are hard-coded urls all over word press. Here are 3 sql statements to update those urls:

  1. Update all post guids: UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain-name.com','http://www.new-domain-name.com');
  2. Update all post content: UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com');
  3. Update all home and site_url options: UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com') WHERE option_name = 'home' OR option_name = 'siteurl';