Migrating WordPress to a new URL

WordPress is a nonsense, and stores it’s URL in multiple places in the database. If you want to move your WordPress install to a different host, exec the following MySQL commands to change the URL in all instances:

UPDATE wp_options 
   SET option_value = REPLACE(option_value, "[Old site URL]", "[New site URL]")
 WHERE option_value LIKE "%[Old site URL]%";
 
 UPDATE wp_posts 
   SET post_content = REPLACE(post_content, "[Old site URL]", "[New site URL]")
 WHERE post_content LIKE "%[Old site URL]%";
 
  UPDATE wp_posts 
   SET guid = REPLACE(guid, "[Old site URL]", "[New site URL]")
 WHERE guid LIKE "%[Old site URL]%";

   UPDATE wp_postmeta
   SET meta_value = REPLACE(meta_value, "[Old site URL]", "[New site URL]")
 WHERE meta_value LIKE "%[Old site URL]%";

Replace [Old site URL] and [New site URL] appropriately

Use this form to generate the SQL for YOUR database

149 thoughts on “Migrating WordPress to a new URL

  1. sms how much to tip casino jackpot (Geraldine) deposit australia, play
    real money poker online australia and online real slots australia,
    or united kingdom online pokies paypal

  2. I absolutely love your site.. Excellent colors & theme. Did you
    develop this website yourself? Please reply back as I’m hoping to create my own personal site and would like to know where you
    got this from or what the theme is named. Many thanks!

    Look into my web blog :: reserve casino lac leamy (Kaley)

  3. best way how old do you have to be to get into kickapoo casino (Hellen) win united kingdom roulette, best australian online casinos and gambling issues
    in australia, or uk poker sites

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>