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

70 thoughts on “Migrating WordPress to a new URL

  1. Its like you read my mind! You appear to know so much about this, like
    you wrote the book in it or something. I think that you can do with a few pics to drive the message
    home a bit, but other than that, this is magnificent blog.

    An excellent read. I’ll definitely be back.

  2. When I initially commented I seem to have clicked the -Notify me when new comments are added- checkbox and now every time a comment
    is added I get 4 emails with the same comment. There has to be
    a means you can remove me from that service?
    Thanks a lot!

  3. I just couldn’t depart your site prior to suggesting that I
    actually loved the usual information a person provide on your guests?
    Is going to be again incessantly in order to check out new posts

  4. I was recommended this web site by my cousin. I am not sure
    whether this post is written by him as nobody else
    know such detailed about my problem. You are wonderful!
    Thanks!

  5. Excellent blog you have here but I was wanting to
    know if you knew of any message boards that cover the same topics talked about here?

    I’d really love to be a part of group where I can get opinions from other experienced people that share the same interest.

    If you have any recommendations, please let me know.

    Thanks a lot!

  6. You could certainly see your skills within the article you write.
    The world hopes for even more passionate writers like you who aren’t afraid to say how they believe.
    At all times follow your heart.

  7. I’ve been surfing on-line more than three hours these days, but
    I by no means discovered any attention-grabbing article like yours.
    It is beautiful value sufficient for me. Personally,
    if all site owners and bloggers made good content material as you probably did, the web will be
    a lot more helpful than ever before.

  8. Hello would you mind letting me know which web host you’re working with?
    I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot
    quicker then most. Can you recommend a good hosting provider at a reasonable
    price? Many thanks, I appreciate it!

  9. Hello there, just became aware of your blog through Google, and
    found that it’s truly informative. I’m going to watch
    out for brussels. I’ll be grateful if you continue this
    in future. A lot of people will be benefited from your writing.
    Cheers!

  10. Hi would youu mind leyting mee knopw which weeb ost you’re using?

    I’ve loaded your blog iin 3 completelyy different internet browsers aand I ust sayy this bloig loawds a
    llot faster thhen most. Caan youu suggest a good internet hosring provfider aat a faur price?
    Cheers, I appreciate it!

  11. I would like to thank you ffor the effirts yoou have
    put inn penning this website. I aam hopingg tto vioew thhe same high-grade
    blog posts frokm you iin thhe futujre aas well. In truth, your creative writiing abilities has inspired
    mme to get my owwn blpog noww ;)

  12. Hmm it appears like your site ate my first comment (it was super long) so I guess I’ll just sum it up what I submitted
    and say, I’m thoroughly enjoying your blog. I too am an aspiring
    blog blogger but I’m still new to everything. Do you
    have any tips and hints for first-time blog writers? I’d genuinely appreciate it.

  13. Hey there! Do yoou kbow if they make any plugins tto awsist with SEO?

    I’m tring to get mmy blog too rank forr some targeted keywords bbut I’m not seeing vedy goo gains.
    If you know oof any please share. Thanks!

  14. Hey, I think your site might be having browser compatibility issues.
    When I look at your blog in Chrome, it looks fine but when opening in Internet Explorer,
    it has some overlapping. I just wanted to give you a quick heads up!
    Other then that, great blog!

  15. Hi there this is somewhat of off topic but I was wondering
    if blogs use WYSIWYG editors or if you have to manually code
    with HTML. I’m starting a blog soon but have no coding skills so I wanted to get guidance from someone with experience.
    Any help would be greatly appreciated!

  16. You need to be a part of a contest for one of the most useful blogs
    on the web. I am going to highly recommend this web site!

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>