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

964 thoughts on “Migrating WordPress to a new URL

  1. casino brisbane united states, are there
    any legal online poker sites in australia and new zealandn online pokies for real money, or paysafe casinos uk

    Feel free to surf to my web blog; Goplayslots.Net

  2. is burswood casino open good friday (Clark) las vegas usa, no deposit bingo
    bonus uk and craps gambling uk, or how to win roulette in casino uk

  3. Hmm it seems like your blog ate my first comment (it was
    super long) so I guess I’ll just sum it up what I wrote and say,
    I’m thoroughly enjoying your blog. I as well am an aspiring blog writer but I’m still new
    to the whole thing. Do you have any recommendations for beginner blog
    writers? I’d really appreciate it.

    References:
    http://karayaz.ru/user/canitaly9/

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>