Oct 1, 2007
My Digital Life Editorial Team

How to Move WordPress Blog to New Domain or Location

For blogger who self-hosts the WordPress blog publishing system on a web hosting server with own registered domain name, sometimes, you may decide to reorganize the blog link URL to make it tidier or to reflect new focus or theme of the blog. If you decide to change the URL or link location of your WordPress blog due to changing of domain name (such as from http://www.old-domain.com/ to http://www.new-domain.com/) or the blog to another directory location (such as from http://www.domain.com/ to http://www.domain.com/blog/), there are some steps that should be done to ensure the proper migration and no breaking links.

The tricky part when moving WordPress blog to another location is that WordPress is using absolute path in URL link instead of relative path in URL link location when stores some parameters in database. Within blog posts’ contents itself, users may also use the old URLs when creating reference backlinks. All these values in the database will need to be changed when WordPress is moved. The following guide will show you which database fields that has references or values related to blog’s URLs that you want to modify. Note that this guide is not about how to move WordPress blog from one server or host to another new hosting service.

Once the blog has been moved (all files copy over in case of moving location or server or new domain name properly propagated across Internet for new domain name), the first thing to change is to tell WordPress the new blog location (wp-config.php should be no changes, and .htaccess file should be also no changes. If for some reason mod_rewrite rules for friendly URLs no longer works, you can always regenerate the .htaccess file via WP Administration’s Update Permalinks page). This value can be changed via WordPress Options page, but if you no longer able to access to old blog URL, you have to modify the value via MySQL database.

Note: The guide uses SQL statements based on MySQL replace() function to modify the database. To run SQL queries, login to MySQL database that houses WordPress tables via phpMyAdmin or login to the DB server and run MySQL client as root.

To update WordPress options with the new blog location, use the following SQL command:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

Browse through WordPress blog to check if everything is okay. You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.

  • Michael

    Thanks :)

  • Flip

    kya chutiyappa hai

  • francesco

    I suggest you the WP-Migrate-DB plugin! Veeery easy!

    • Picha

      Abe chutiye

  • Jared

    Nevermind… I just needed to update my permalink structure. *phew* I thought that was going to be a lot harder… ^_^

  • rachel

    I tried this but I’m not sure what database I need to be in? And when I try entering the code I recieve the following error message
    “1146 – Table ‘rsydowde_04_02_2012.wp_options’ doesn’t exist”

  • edekzkrainykredek

    you shouldn’t change GUIDs,

    it will confuse feed readers associated with your site because they use GUIDs to distinguish posts from each other

  • Aryeh Beitz

    Just click Tools -> export. it will save the entire site into an xml file.
    then in the new site, do Tools -> import. viola!

    • Daniel

      Well, now i have used your site the past 2 years to move my blogs (i always check your site to copy/paste your code in sql) and THIS is the best and fastest way to move your WordPress.

      So thanks for your article. (just want you to know)

      • Pablo Karzin

        Me too. I have used your site for the past 3 years

  • Cody

    This worked for my photo gallery, so glad I found this.

  • Pingback: Handy References for horizontal list, colors, and moving WP to a new server « Karen Alma Arnold

  • AJS

    THANK YOU!!! This saved my life, I cannot even explain.

  • http://www.deinegutscheine.com/ Jeronimo

    Hi,

    thank you very much for this tutorial!
    has worked fine for my domainchange.
    very helpful if you want make an update for previous testing.

    kind regards!

  • http://www.jmonit.com Monit

    Thanks A Bunch!

    Great Trick to have under your belt.

  • http://timmyhoward.com Timmy Howard

    Great write up guys you saved my life with this. Thankyou thankyou thnakyou!!!

    T

  • Nasko

    Great tutorial! Use it!

  • http://csj.dyndns-blog.com/ csj

    Very useful and thanks this helps me change domain name easily.

  • http://maheinfo.blogspot.com Mahendra @MaheInfo

    Thanks for your info and this is working fine and I would like to appreciate for your some very important article which I got just on this site

  • Demian

    I am trying to move one DB (named wktdatab01) to another site, wich already have one DB empty (named dignadatab).

    But I can´t as it seems that this different names are affecting it. How can I solve this? and import the tables from wktdatab01 into dignadatab ?

    Thank you!

  • Markyboy

    Fantastic info got me out of a very tight copy over/ install dead end. Best wishes to my friend!

  • Rosana

    Hi, thanks for the instructions, it worked half the way for me. The index looks ok but when i click on a menu button to go to a page or post i get an error like the page doesn´t exists. Any idea ??

  • Ola Löfv&eacute

    Great guide. I also put up a guide, and recently moved a few installations when changing webhost. Perhaps your guide is a little easier to read ;)

  • Kilian Güntner

    Thanks! Great tips, swapped domains in just a few minutes

  • bubbles

    For some reason when i copy and paste it tells me that i have a problem with the syntax?! anyone got that as well?

  • DNS Lookup

    All these values in the database will need to be changed when WordPress is moved. The following guide will show you which database fields that has references or values related to blog’s URLs that you want to modify.
    ________________
    Kim

  • Jeremy Penrod

    I've honestly used this article more than once. Combining those three SQL calls into one fell swoop makes transferring a WP domain literally take 30 seconds.

    Thanks for posting this.

  • Ian

    If you've got phpmyadmin locally, it seems like you're better off to export to an SQL file and then run a simple find & replace on current wp-root and replace with new wp-root. ie: http://localhost/blog with http://mydomain.com

    Save sql file, import into DB, upload files. Faster and easier than mysql functions and its a one step process.

  • Phi

    I upgrade my wordpress blog (*******.wordpress.com to *****.com
    But I don't know how to upload a file onto it.
    I want to use Google Apps for my domain, and it requires uploading an html file to verify.
    Can you help me?

  • Buddy Hannon

    Thank you. You took what was going to be 1.5 days of PITA work and allowed me to get it done in 10 minutes!

    You rock!

  • David Bressler

    Hi,

    Thanks for the well written explanation. However, I still have a question.

    My server isn't moving, I just want to change the root URL from http://old.com to http://new.com. Everything else, remains the same, the server remains in place.

    In fact, I still own both domains, today I redirect http://new.com to http://old.com.

    What I'd like to do, is redirect old.com to new.com, so that my branding reflects the new domain name.

    Since the old domain will still work, any old hard-coded links should still work.

    Therefore, my question – is all I need to do to make this work, change the the WordPress and Site Addresses in General/Settings to the new domain name from the old domain name?

    I shouldn't have to change any of the existing hard-coded links (like you mention above) because I still own the domain and am redirecting. By the way, it's a new site, so I don't have much google search history that I care about, so any performance hit or search engine optimization I lose is OK in this case.

    Thank you,

    David

    • Dave Y

      Dave B.,

      I don't think so, especially if you're using permalinks. After following these instructions, cleaning the database, and the control panel, all my permalinks still had all the old urls in them.

      I picked up a plugin called 'search and replace' to police up all the 'old.com' references.
      My activity was very similar; same hosting company, same database used the only thing changing was the domain.

      If you just change the admin panel, and follow the rest of the instructions the blog should still work- ours did. But, as I mentioned we had a bunch of dead links, etc.

      HTH
      Dave Y

      • David Bressler

        Thanks Dave. Sorry it took so long to get back to you. I appreciate the help though.

        David

        PS I've got it moved over, with a little help from my service provider and not very much drama!

  • jsml

    THANK YOU SO MUCH FOR THIS. I looked in a million other pages for solutions and this finally did the trick.

    THANK YOU.

  • SHE43P25UC

    Thanks for the great tips!

  • J

    Thank you for the guide, worked fine!

  • reader

    Hi,
    Isn’it possible to avoid absolute links in a WP site ?
    HTML propose 2 cases absolute references or relative.

    Why not use ONLY relative links ?

  • Haris

    Very helpful post,

    really helped me

    thank u very much.

  • Dave Y

    hmm… I executed all the steps above, and it did work pretty quickly. A couple of things.

    I think you need a database export(sql) from "old-site" and imported to "new-site". My ISP had an FAQ on doing this at their site. I executed the sql updates above and all my links were converted -except- links to my blog posts within blog posts.

  • Vab Media

    This is a great guide! I always refer back to this when I need to do a migrate a wordpress site to a new domain. It's so easy to do!

  • Bobby

    Thanks a bunch for this.

  • Weavr27

    Thanks so much for this guide. It was very helpful. I am able to get into my wp-admin again!

  • Pingback: Remove Date (Year/Month/Day) in WordPress Permalink URL Structure with Redirect Rewrite Rule in .htaccess « My Digital Life

  • My Sovann

    Very complicated guide, My english is also not good enough then leading to more and more difficulty to reach the destination. Actually, it quite good info.

    I'm still looking forward to getting help from u.

  • estrenos 2011

    Thanks so much for this very helpful guide.

  • Christine

    You are a lifesaver. Thank you so very much for this helpful guide. Cheers!!!

  • rahul

    Thanks for that article… after that i cant able to login in my wordpress please help what was wrong ?

  • Toyin

    Thanks so much for this very helpful guide.

  • formulablo

    nice share, after all step above, goto admin and upadte databse… dont forget to activate plugin and theme

  • Gary

    Thanks for the SQL scripts. It's definitely worth running the scripts for both 'http://www.old-domain.com' AND 'http://old-domain.com' just in case some URLs contain (or don't contain) 'www'.

  • Alientyc

    useful mysql statements even today for wordpress blogs! :)

  • Pingback: Best method to migrate Wordpress from dev server to client server - DesignersTalk

  • shiroku

    great script, i have changed manually the database but it didnt work, now i use this script everything works..

  • Avi

    really helpfullll…

  • Brandon Kitajchuk

    The only other thing I needed to do was update the new domain in wp_links table under the link_image field.

  • Brandon Kitajchuk

    Wow, thanks man! This worked like a charm :)

  • em

    Did not work.. I still cannot log in to my admin… I get no web page at all here..

  • Deb

    Has anyone tried the plugin WP Migrate DB? I might give it a go.

  • Locksmith

    I am beginning a blog for my organization and found the article quite useful. Thanks for the ideas!

  • Pingback: Has anyone used Backup Buddy? - DesignersTalk

  • Captain Howdy

    Absolute lifesaver, this worked perfectly!!

  • Toyin

    This was very helpful. had to edit wp-config with the new database details and worked perfectly after that!!Thanks

  • adam

    sorry for the triple thing. the post with "please remove earlier comment" seems messed up. just use my very first post. sorry for the problem caused.

    Adam

  • adam

    i used the raw way to transfer my wp 3.0.1 to another server, with the same domain name (repoint dns server, create addon domain, bla bla bla).

    1) backup mysql, the raw way. (the .sql file)
    2) transfer files, the raw way. (ftp, nothing else)
    3) move to new site,

    i. mysql -u blabla -p db http://www.domain.com, save it. Back to the same column, remove www, save it again. It somehow update somethin and save my day. hope this is useful to others.

    Adam

  • krembo99

    Thanks, those commands saved me a whole lot of work !

  • ta

    Great! Thank.

  • Bilal Ahmad

    I have a question. As the blog in my hostgator is installed on old domain. How will the hostgator recognize that the blog is now on the new domain. And we have to change DNS setting for the new domain or not.
    We have to just add the new domain in hostgator and then follow the above steps. Is it Ok?

  • http://alonpeer.com Alon Pe'er

    Daniel Doezema offers a script that helps migrating the website to a new domain: http://github.com/veloper/WordPress-Domain-Change

    I've added MU support to that script, which is available for download here: http://dl.dropbox.com/u/1205235/wp-change-domain….
    For MU, after you run the script you must also update your wp-config.php and change the constant DOMAIN_CURRENT_SITE to the new domain.

    NOTICE: My MU version wasn't tested a lot, so BACKUP ALL YOU DATA before running it.

  • thomassabo-charm

    Great!very helpful!thx!

  • Tom

    Very good post if you want to take the time and do this manually. I can do this for you or there is a real easy way that this can be done in under 5 minutes if anyone wants to contact me. I can help if someone doesn't want to do this themselves.

  • Emanuel Dávil

    thanks!, saved me :)

  • mala

    i have a new blog but i dont know how to use domain in my free blog

  • khadijah

    how do I enter a domain name on our blogs

  • Krystle Notoma

    good post

  • John

    Perfect. This made modifying some 500+ records about one minute of work. THANKS!

  • empty

    Good work ! Very useful.

  • Jasper Tey

    Thanks for the article; saved me a huge hassle in trying to figure it all out myself!

  • Carie

    Thank you God for posting this. Once I figured out how to not get that No Database Selected error I was good to go. Saved me sooo much trouble. Thanks so much. Amen.

  • Pingback: How to Move WordPress & Change The URL | Coyote Mercury

  • Server Migration

    Thanks for this tutorial it really helpful…Thanks a lot.

  • El at Tantalizing St

    Hello and thank you so much for these directions. It worked wonderfully to move my elephant dance blog.

  • Andy

    Smee,

    the only way that command would've replaced the entire post contents would be because you made a typo. The syntax is absolutely correct, and I have performed this operation multiple times without issue.

  • Bakos

    cool picsxx

  • http://h Arnie

    I tried this. However, it failed. Is the theme you are using also involved? After moving the sight it was as if the CSS style sheet wasn't detected.

    I urgently want to move my sight to a new domain. But I haven't found a way to do it that works. I'm using WordPress 3.01 and the Magazine Premium theme version 1.1.2.

  • Arnie

    Has anyone tried this with the new wordpress version 3.01?

  • Tony

    Thanksssssssssss

  • Shovan

    You should do this as well

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com&#039 ;)

    this will replace other url in the option table

  • vickie

    Great info on all the stages, thanks!

    If (like me) you're not entirely comfortable working directly in the database
    http://wordpress.org/extend/plugins/search-and-re

    is a really good plugin that does this part of the job for you so worth checking out (updated for 3.0)

  • Smee

    Sadly, the command:

    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

    ended up replacing the entire post contents.

    Then mysql database backup never happened, so it screwed me over. :(

  • Sebastian

    One more thing, also make sure to change all the directory references when moving the blog, if the blog is installed in a new sever in a different directory you must update that too

  • Nehemoth

    I found my problem, as the time have passed by, I have multiple tables, so my Table_Prefix should be set to the correct table set.

  • Nehemoth

    Hello, First I know this post is old but still, maybe someone is watching it.

    I'm trying to prepare myself for a future host from host migration, so I want to do the testing locally, so I've done all that is listed here.

    Done the wp-content backup
    Done the DB backup
    Create a New DB
    Create a New user
    Set permissions to new user
    Restore the downloaded DB into the new database
    Installed wordpress
    configure wordpress
    update via commands the new domain and all stuff

    The connection all went just fine, but no one post appear, no information in the blog.

    I know I can do an export/import via wordpress but I want to do it via the SQL DB (hard) way.

    BUT i know I'm doing something difference which I do not know if should be done in this process :

    First I installed wordpress on IIS (just for the sake of learn how to)
    Second I'm using a different version of wordpress from the actual blog. I have wordpress 2.9.2 in the production site and wordpress 3.0 RC1 in the development site.

    As I said before, my problem is that after I did everything as told me by every guide that I could find, I can not see the information even as the site is working.

  • TexasLaw

    Just letting you know you helped someone else out!

    thanks

  • Ahiaruhe

    You're a lifesaver mate!

  • Fahad

    Who ever you are man,,,

    I really thanks ful to you,

    You have solved a real problem , till yet this is the only solution which works for me.

    May God reward you

    Ameen
    Once again thanks alot brother

  • Joseph

    Thanks for this guide it really helped me :) I was so desperate in the start…i thought i lost everything and now my new blog is up and running without any changes/problems.Thanks a lot.

  • Arata

    Thank you for posting this guide.
    It helps me moving my wife's site to a new domain.

    -cheers-

  • Todd

    Great share, keep it coming!

  • Annie Boga

    Greeting to you from Seattle, great article, lots of help, tnx :) xoxoxo

  • Tim Gagen

    Thank goodness for this post! Finally someone who actually knows what they are doing. I got incomplete instructions on this for the past 2 hours. Great value, great post.

  • Jonas

    Great, now it works for me! Don't forget though, if you are using a subfolder where the name has changed, like new_domain.com/newblogfolder, you may have to change the .htaccess file in the blog root directory.

  • majalah

    I have trouble setting image URL when moving to new host. thanks for the guide. It makes me clear.

  • Dave

    Thanks for this, it really helped me out!

  • miso2004

    Thank you again! Good advice. Saved my life.

  • miso2004

    Thank you !!! You've saved my life!

  • David Radovanovic

    Thanks. For around the fifth time, I used your guide to successfully move various WordPress websites. ;-)

  • Tom

    You saved me on this one, pal. Thanks!

  • Firman

    Very helpful. Recently I moved my wordpress blog to a different domain and all links broke, styles were not applied, etc. Thanks for sharing this.

  • Pingback: ToDo Liste – Umzug eines WordPress Blogs auf eine neue Domain - Majeres.de

  • Kodama

    Do you bother with the settings > set default url or just run the MySQL commands to change a domain name?

    I backed the whole thing up with WP-DBManager 2.50 and my new domain already points to the blog. Just nervous about following the commands to change to new URL. Nothing else changes, not moving just using new domain..

  • Luis

    Saved my life! Excellent guide. Many thanks… you are a gentleman and a scholar.

  • http://crunchydata.com Kim

    Thank you so much for the instructions. Worked perfectly to move my goddaddy site. I really appreciate this excellent resource and have subscribed.

  • sam

    Very good, save the good thing.

  • serhat

    wow very nice thanx

  • CSS Coder

    As a theme developer, I need to move wp sites to and fro between localhost and production server. This article saved my life! And I can't count how many times I've visited this page in past.

  • Yash

    Worked for me..!!! Thanks..!!!

  • bolsas femininas

    Enjoyed reading this one.. tried the to add this website to google RSS reader but it didnt really work, any ideas?

  • luk

    thanks! really helpful

    would just like to add a reminder about the upload_path field in the wp_options table

  • Michael Scott

    THANKS!

    Completely made my day! Took me all of 30 min to migrate everything to a new domain name.

    Good on you mate!

    Michael

  • http://tarafenton.com Tara Fenton

    Saved my sanity. Thank so much!!!

  • anonymous

    WOW! Worked so good! THANKS! How did you figure this out? Google?

  • http://www.affordmarketing.com Michael

    Very clear and concise, this helped tidy up some SQL server moves.

  • Steve

    Will this work with wordpress multi user too?

  • http://www.streetandrollers.com Ariel

    Was clear, and it worked perfectly.

    Thanks!

  • http://xtmas2009.magaworks.com Margarida

    I am trying to move my blog to another subdomain on my domain, i copied everything to the new folder and run the SQL queries you say in here, but it gives me an error I have no idea what it is because I no almost nothing about PHP.

    TDOMF ERROR: Headers have already been sent in file /home/edad3/public_html/globesfortheglobe.com/wp-settings.php on line 18 before session_start() could be called. This may be due to…

    Your current wordpress theme inserting HTML before calling the template tag "get_header". This may be as simple as a blank new line. You can confirm this by using the default or classic WordPress theme and seeing if this error appears. You can also check your theme where it calls "get_header".

    I have seen the files they mention and still don't know what to do. Can anyone help me? I am using WP 2.8.6 with some plugins.

    Right now I changed back to the old subdomain because there everything works fine. I don't understand how there could be a problem since I copied the files from the old subdomain to the new, so everything is the same.

  • Andrea

    This was extremely helpful information. Thanks!

  • http://blog.christophevigneron.fr Christophe

    Excellente information ! Mille mercis.

    Great post.

  • Pingback: How to move a Wordpress site « Ugo's dusty attic

  • ari sihasale

    haii.. nice post kawan…

  • http://semantica.us james

    … the replace command is taking FOREVER for me : 20 minute so far. Is something wrong?

  • http://holidaydealsonline.wordpress.com Race

    Thanks for the write up dear ….

  • http://www.gawrilla.com Kevin Pruett

    very helpful…thanks

  • http://www.codingbeaver.com Jeffrey

    It is very helpful.

    Thank you very much.

    Jeffrey

  • http://adam-sharp.net Adam Sharp

    Thanks for this, it was really helpful. Especially the bit about changing links to my own blog—I hadn't even thought of this issue, and now I won't have to.

    —Sharpy

  • http://www.vishnuvalentino.com/wordpress-domain-name-migration-plugin Domain Name Changer

    You also can use WordPress Domain Name Changer plugin

  • http://kingsolutions.org.uk Phil King

    Many thanks for a great article, just what I was looking for. You might like to add a footnote for those who use relative paths in their blogs for internal links to simply search and replace on the relative path in exactly the same manner as your search and replace method for absolute paths.

    Once again many thanks, Phil at KingSolutions

  • Williecoetzee

    Thank you! Thank You!

  • Pingback: Machinadei.com » Moving a Wordpress Website

  • http://www.zigzagzz.com zigzagzz

    nice article !

  • Pingback: Tech: Moving Wordpress to a different Domain | Chatter Of The Squirrel

  • Pingback: Copying a WordPress Blog to a Different Domain | David’s Technical Musings

  • http://artballs.co.uk nathan

    There is nothing I could find on the WP codex that describes these completely essential steps of the migration process completely. Also, the MySQL commands is by far the most difficult bit to understand. Awesome stuff and thanks. I followed your steps and it works (and I understand it too).

  • Joel Lundgren

    Thank you..

    Now I can sleep again..

  • http://www.iwants.com Kelsi Guidry

    I just want to say thank you very much for this article and for your time creating these SQL statements.

    Can i say I Love You?!?! haha

    Thanks,

    Kelsi Guidry

  • http://www.revtrev.com revtrev

    The only issue I found was that the new site keeps trying to upload media to the old site. Is there an easy way for me to change this? Where would I look?

  • http://www.revtrev.com RevTrev

    Thanks so much for the help for me to merge my blogs. You saved me a tonne of headaches.

  • http://www.markusweigelt.de Markus

    It's it not necessary to do anything in database for migrate the url to another domain.

    There is another way with this simple steps.

    1. change Blog address and WordPress adresse (Url) in your general settings -> safe changes

    2. go to settings -> permalinks do nothing and save changes

    so the blog urls been updated.

    please give me a response …

    greetz Markus

  • http://www.samdiener.com Sam Diener

    Thank you for this advice. It really helped me.

    Sam

  • http://www.calyptratus.com nico

    Thanks for the tips !

  • Pingback: How to bundle plugins into a new WP theme

  • Mike

    I followed the above steps for moving to a new location in my server and also a new domain name. While everything works fine I am not able to login to wp admin. It takes the user p/w but gives me HTTP 403 error in internet explorer. Please help.

  • http://www.ejakulasi-dini.com ejakulasi dini

    Thanks for making this tutorial, now my problem is solved. Thanks.

  • http://www.sooran.com sooran

    thancks

    this post very very helped me !

    Good Time

  • samuel

    For me a much easier way to do it is:

    1. Do a database dump with the mysqldump command.

    2. Replace all occurrences of http://oldsite to http://newsite

    3. Restore the database with the modified dump

  • http://www.jonstout.net Jon

    Just wanted to say, thank you – this post was a big help.

  • http://dweebsonduty.com Shane Burgess

    Why don't you just change the domain in the options just before your ready to move. That's how I did it and it worked great.

  • http://www.millardclark.com Millard

    Great information for sure, but I confess it seems too much work for my purposes. I think I will keep the domain I have. Thanks.

  • http://blog.trendmicro.sg Internet Threat

    thx a lot. It seems a lot easier than I thought. Implementing this on my blog was quicker than writing my post above.

  • Pingback: Moving to new domain – Saved for later reference

  • http://www.netfleet.com.au/ David Lye

    Thanks for the info – don't forget to post about the Australian domain name industry – it's really starting to take off… Thanks again

  • http://www.nashvilleinteractive.com nashville web design

    man, you rock. This just saved me an hour of head-banging. worked like a charm the first time.

    thanks!

  • Pingback: 修改域名后图片无法显示的解决方法wordpress | 中国海盗湾

  • http://www.rothco.ie/blog Niall Flynn

    Great Post, saved me ages, many thanks!

  • Pingback: Designer WPF » Blog Archive » Designer WPF is now Designer Silverlight

  • Pingback: how do i change the domian of my blog , just bought a new..

  • Pingback: Migrace Wordpressu na jinou doménu | Milan Knížek | fotografie, linux

  • http://mejo.co.uk mejo

    lifesaver! thanks for this, have been scratching my head for a week or so trying to solve it on my own.. thanks

  • Pingback: Verhuis | Past is prologue

  • http://mister-doe.blogspot.com Bryan

    I just imported 175 posts from a Blogspot fiction blog into a new WordPress blog that a friend is offering to host for free! Problem is, I was using a custom book-inspired layout that showed one post at a time, with a series of menus linking the various posts together. Now all those menu links still point to the old posts at Blogger.com. Would the above technique convert those links quickly once the WP blog is hosted? Cause right now I'm resorting to cutting and pasting…

  • Pingback: Updating All Internal Links in a WordPress Blog | Code LOL

  • http://webguy303.com Web Guy 303

    Thanks for the info, great guide for moving a WP site – I send people to this page all the time when they ask me how to do it.

  • http://www.webshost.net sparsh

    thankyou for the nice and helpful information.

  • http://www.dbgg1979.com Brian

    I was really confused why things were pointing back to the old domain. This guide made it really easy for me.

    Thank you so much!

  • kelly80321l

    I just moved 3 of mine using this guide. Made it easy for me. thanks

  • http://www.divorceline.org DivorceLine

    Тhank you very much, very useful info.

  • http://www.wpthemebuilder.com Wordpressthemegenera

    worked perfectly – many thanks !

  • http://www.samoversandshakers.com Mike

    Thank you so much for this! I just had to transfer my blog to a new site and this was very concise and helpful.

  • http://www.loginandlease.com Mike S

    I couldn't have done it without you!! Worked perfectly and very simple. Thanks.

  • http://addurleasy.com Free Web Directory

    after moved my blog in to new host i can’t login my blog ??

    Why ??

  • http://www.allergycheckpoint.com/ Sajid

    Thanks so much for this!

  • http://www.heritageofpakistan.com Pakistan

    Discover the beauty of pakistan. Learn the culture, heritage, traditions and landmarks of different parts of Pakistan especially sindh, punjab, balochistan and N.W.F.P and far northern areas.

  • Jez

    Thanks Great Help

  • http://www.incomesinternational.com Andrew Kolyvas

    Just moved my blog to my new domain <a href="http://www.incomesinternationl.com” target=”_blank”>www.incomesinternationl.com.

    Worked perfectly.

    Thanks, I appreciate your work.

    For those that are having trouble, when using phpmyadmin, make sure you click on the SQL tab then copy in the the 3 queries that have been provided here. Make sure you change the vales for the old-domain.com and new-domain.com and that is all that you will need to do.

    Andrew Kolyvas

  • http://www.tntoyun.com oyun hileleri

    Thank you. This worked perfectly.

  • http://www.citylife360.com StoneTalker

    it works perfectly.Thank you for sharing this great information with us.

  • Phantom Paul

    Brilliant – worked perfectly – many thanks !

  • http://compilersystem.com Daniel2b

    You totally saved me I never would have known how to fix it! Thanks so much!

  • http://ANYONEcanmakemoneyonline.com Infopreneur

    Awesome info, this saved me some great webmastering time! Thanks!

  • http://www.thinsk.in Ryn Garcia

    Thank you. This worked perfectly. =]

    All I did was copy and paste. =]

  • http://www.TheAccidenatlSuccessfulCIO.com Dr. Jim Anderson

    Great article. I just moved my WordPress 2.7.1 blog from one domain to another (same server, same MySQL database). A couple lessons learned:

    1. It's REALLY important that you get your quotes '' correct. I cut & pasted the SQL commands and they didn't work the first time because the single quotes were too fancy – I typed over them and all was good.

    2. The odd thing was that the three SQL commands didn't change a single thing. I believe that the two plugins had already made all the required domain name changes.

    3. There is a wee bit more editing that you need to do in the MySQL DB – you can do it via phpmyadmin. The tables _users, _usermetadata, and _options all need to be reviewed and all occurrences of your old_domain need to be replaced with your new_domain.

    4. THIS IS THE ONE THAT GOT ME: please be aware that phpmyadmin will only display the first 30 or so columns of data in a given table. The _options table has MANY more columns than 30. If you forget to change ALL of the occurrences of your old_domain, then you may encounter a "You are not authorized to view this page" error when you log into WP after making your changes.

    5. Don't forget to edit your wp-config.php file in order to change the name of the MySQL database tables being used in the $table_prefix variable.

    Good luck and make a backup of your database BEFORE you start!

    - Dr. Jim Anderson

  • Pingback: Moving Your Wordpress Blog To A New Domain Name, The Ins and Outs…

  • Pingback: Installation « How To

  • Pingback: How to Move a Wordpress Database | Always Get Better

  • http://www.domainsbeetle.com domain name

    Yeah, I had that problem with my domain too. I bought a new domain name and when i was transfering my blog onto the new domain, all messed up and i lost a lots of my data:(

    Anyway i recovered after some time, it was obviously in the beginning. :)

    But i'm sure information you have provided here will be helpful to may others who are looking forward to shift their blog to a new domain name.

  • March

    Hello, i have installed wordpress to domain.org, but i need to have domain.com as main domain (domain.org i wolud lik to be parked) of that installation. If ponit name servers (domain.com) to hosting where is wordpress installed would by blog work??

  • Pingback: Media Temple: Moving WordPress and MediaWiki from (gs) to (dv) | indigoprime

  • Alex

    works perfectly. thanks!

  • http://heliopaz.com/ Hélio Sassen

    Hi, folks! ;)

    I'm beginning to transfer the content of a free WP.COM blog to a payed domain and hosting service that supports WP but I still can't do it. ;(

    How is the procedure when I need to transfer all content posted on a free WORDPRESS.COM to a payed hosting service with my own domain?

    I want to transfer my wordpress.2009-03-19.xml from heliopaz.wordpress.com to heliopaz.com but the wp-admin doesn't allow me to upload a XML heavier than just 2 MB and my XML has 13.7 MB.

    My host provides a great job but the online chat couldn't help me and I'm waiting so long for the helpdesk response.

    Any solution? May I have to ask my host (or even pay a few more bucks) to increase the space from 2 MB to 15 MB on my heliopaz.com wp-admin page?

    Or could I use a FTP software to upload my XML file to a specific directory? In this case, where exactly I have to upload this file?

    Thanks a lot!

    Hélio Sassen Paz

    Porto Alegre/RS

    Brazil

  • Pingback: Casual Commerce » Wordpress Notes — Going live from local development environment

  • http://www.webrevolve.com/ Webrevolve

    Excellent post, thanks for sharing, you've just saved me loads of time messing about

  • Pingback: Moving to osama-gma.net

  • Niels

    This was a great help to me, thanks! I'd just like to add that in WP 2.7 I also had to got to settings>permalinks and hit the save button again to reset those (I'm using 'pretty' permalinks.

  • http://www.bestlcdtvs.org TV Me

    Great guide here for managing WP sites. Many thanks!

  • http://www.lightbeingcreations.co.uk Dan

    Great stuff :-)

    Clear and easy to follow, just how a help page should be. Bookmarked for future reference.

  • susan

    Wow, thanks! I was really afraid to do this (without knowing if I was doing it correctly), so I just decided to go for it and copy-paste 1-2-3. It worked! Note: also, I had to go take out the old index placeholder file I had up there at the designated location. Once that was out of the way, it all showed up.

    many thanks again – most helpful!

  • http://www.hagel-it.de Jens

    Thanks, this helped me a lot. We are currently moving 2 WP-blogs to a new location.

  • Dan

    worked perfectly. one thing to consider is you have to be patient. it took about 15 min for the changes to propogate even after i cleared my cache. i know it makes no sense but thats the story!

  • Pingback: How to transfer a big wordpress blog?

  • http://goaclub.es Alejandro Sevilla

    I think 2 more queries should be added. Many people use additional fields to store queries for thumbnais and there is also info about attachents.

    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com&#039;, 'http://www.new-domain.com&#039;);

    UPDATE wp_postmeta SET meta_value = replace(meta_value, '/home/old-domain/public_html', '/home/new-domain/public_html');

    * This last one may depend on the host home directory and structure.

    Long life wordpress! :)

    Cheers, Alex from spain

  • Pingback: WordPress Blog zu neuer Domain verschieben | Dirks Blog

  • http://forofundacionserranosuñer.es alex

    Any one knows, what happens when the destiny domain is a IDN domain (forofundacionserranosuñer.es). I am having big problems and maybe this is why?

    Thanks,

  • moin

    hey,

    You have said that "Note that this guide is not about how to move WordPress blog from one server or host to another new hosting service." But if I want to do this how it is possible. If you have any solution please reply.

    BR

    moin

  • Pingback: memo: change wordpress domain name « Konstantinos Koukopoulos

  • http://www.kamarsutra.co.cc KamarSutra

    Thank you very much. I've successfully move 2 blogs by referring to this tutorial. Thanx to the writer of this post.

  • http://www.billandtamara.com Bill Hutchison

    Thank you very much, following your directions helped me to make the migration without any trouble at all.

    What surprised me most was that all my plugins worked right away as well! I was expecting trouble there, especially with NextGEN Gallery.

  • Jørn

    Thanks!

  • Hayley

    Hey this has helped me so much! Thanks!

  • Blake

    I tried to enter the code, but kept getting errors. what did i do wrong?

  • http://www.google.com mike

    ERay55 hi! how you doin?

  • Pingback: Migrasi Lagi… « —-aulia_ra—–

  • Pingback: Migrasi Lagi… | www.aulia-ra.org

  • Pingback: Blog upgrade « Critical Exponent

  • Pingback: Problemas de migración | /dev/GON

  • Pingback: Piplos’ blog » Spostare WordPress su un altro dominio

  • Flip

    Thank you very much!

  • http://www.phoenixgaragesystems.com Help

    Could someone possibly interpert this info and lay it out a little more basic. The writer is on track but not very helpful on the step by step aspect for us more basic users. I know this is what I need to do but cant tell where to do some parts in the host or in wordpress.

  • http://www.woutervolkeri.nl Wouter Volkeri

    Thanks man. Everything is working again! :-)

  • http://lyna-keat.co.cc Lyna

    It's perfectly working!

    Thanks a lot!

  • Pingback: De VinnieBlog site is verhuist !!! |

  • TauAs

    Thank you very much! everything works perfectly.

  • http://pacura.ru Ovidiu

    need some urgent help guys. my move from subfodler to root wen smoth, excet that now, evry page is extemely slow, even if I only browse through the backend :-( Ieven put the site in maintenance mod and deactivated all plugins and still as soon sI hit any page o this blog, cpu load goes to 80% nd the page comes down to a crawl. l other sites n thesame server are still actin normal.

    ts leads me to th assumption that there are ome rdirects somewhere which are slowing it down. any hints what to check?

    Except from the slowliness all is workin :-(

  • http://pacura.ru ovidiu

    also one might have other places that mention the old url, so this plugin could also help: http://wordpress.org/extend/plugins/search-and-re

  • http://pacura.ru ovidiu

    just moved my blog and this page saved my life.

    have to point out though, that I was not using the default table prefix :-) but that was easy to figure out.

  • http://blog.jccrosby.com/index.php/feed John

    You're a rock star! Worked like a charm. Thanks a ton!

  • http://mail.com Serggg

    I follow him to serve my turn upon him:we cannot all be masters, nor all masters.Cannot be truly follow'd.

  • Pingback: Webspace of Eric Brodeur » Moving a WordPress blog to another folder

  • Pingback: how to move a local wordpress to live blog? | Blog Design Studio

  • http://colrosa.co.uk malcolmm

    very useful post – thanks. I saw mention of the plugin, but I prefer to do it this way, so that I can see what I am doing to the database.

  • http://wiifitstock.weebly.com Andrew Wii

    Great effort of providing latest Word Press information.

  • http://jagtesh.tumblr.com Jagtesh Chadha

    Thank you! You're a life saver!

  • Pingback: Random writings » 转移WordPress到另一个URL

  • http://www.velvetblues.com Velvet Blues

    Great post. We just released a plugin which simplifies this process for people who don't want to, or don't know how to, use phpMyAdmin.

    All users need to do is upload the plugin and enter their old and new urls. Then presto, All links are updated!!!

    Check out the Update URLs plugin here.

  • http://www.lifeiseasy.cn lifeiseasy

    wow, thanks for the information..:)

  • http://www.scriptbazaar.com/ turnkey websites

    thanks for the great info i was having a blog of jokes

    http://www.top-jokes.info where it was difficult to load and after making the changes you have listed above its been very easy for me to use the old website da a on my new domains.

    thanks again.

  • Pingback: alex robinson » Blog Archive » Migrating mom’s wordpress

  • http://www.7ota.com/blog/ 7ota

    Thanx for that , its help me soooo much

  • http://www.mesterweb.no/webutvikling/joomla/publiseringsl%C3%B8sning.html Joomla CMS

    I have been using Joomla CMS since it's beginning and really love it.

    At the moment I am considering to use WordPress as my blogging tool, and since this guide illustrates the easiness of the movement process, I am feeling a bit safer to convert :-)

  • http://www.6i6.de Autoversicherung

    My Favorit Blog. Very thanks and best regards from Germany. Thanks

  • http://mirosol.kapsi.fi mirosol

    Just used your tutorial and it worked great! Thank you very much!

  • Pingback: The Forgettful Website Developer » Blog Archive » Moving a WordPress website to a new host

  • Pingback: Mudanza del blog | Thuer.com.ar

  • Pingback: How to move wordpress blog to new domain or location - Drosophila Genetics and Epigenetics

  • Pingback: WordPressのURL移転時の内部リンク書き換え方法覚書 - SharpLab.

  • http://www.cathylopez.com cathy lopez

    You just save my life! lol!

    Thanks for your article.

    It worked great! No fuzz!

  • Pingback: Welcome to c64glen.com at C64GLeN - The blog of Glen McNamee

  • Pingback: Smuggle Me » Export One Wordpress Blog Category to Create a New Blog

  • Piotr

    great info :)

  • Pingback: How to move WordPress blog from old domain to new domain with 301 permanent redirection - SEO / SEM blog

  • http://tinkin.com Ken Hung

    YOU TOTALLY SAVE MY LIFE!!!!!!!! THANK YOU SO SO SO VERY MUCH! Yea!

  • NAthanT

    Gold information.

    You saved me hours.

    Cheers

  • Pingback: We’ve Moved… Everything Must Go! : Foo Kabloo!

  • http://designer-wg.de Simon

    Hi folks,

    I had the same probs, butt I never knew on what it depend's.

    I changed the sites Url in the admin area of my WordPress-blog, but that was an fault.

    So nothing would be shown on the right place.

    Therefor I needed to change it back, but there is no way to get in the admin area again logically, after I've changed the root Url.

    So I opened my mind to get a solution. And just in this Moment it comes over me:

    …only go on your hosting surface and start PHPmyADMIN and find the following database entry:

    "Your WP-Blog database"–>wp_options–>make this database Entry editable–>now find the row "site_url"–>and change in the "options_value"column the root of your blog–>safe it and it's done!

    greetings, Simon

  • Pingback: Designer-WG » Blog Archive »

  • rebel

    yes there are open
    http://www.demonoid.com/

  • Nikhil George

    Thanks for that. When I googled for this topic another blog said , to this you have to backup the entire database, create new db and upload again. I was really tensed, but this was actually completed in seconds…..:)

  • Pingback: ——Sahil Seth dot com—— » Back again…

  • http://yeeeah.com Phil

    Thanks a lot for this tutorial! I've been wanting to do this for months but never dared because I was afraid of losing all my hard work. You really saved my day.

  • http://www.bailingbucket.com Rhett Soveran

    Thanks so much for this post. It was tremendous help. That was so easy to follow and worked perfect.

  • Pingback: scriptygoddess » Blog Archive » Moving a Wordpress Install

  • http://www.no2id-worcester.org.uk Worcester NO2ID

    Thanks for this!

    Everything working. Thanks for providing this valuable resource. Was invaluable for helping move our prototype WordPress installation from my home server to full on hosting!

  • http://www.spdesign.co.uk Stuart

    I had no problem running the first query – the site found the home page instead of displaying a 404 error.

    But whilst the second query executes (I am told 2 rows are affected) and when I click a link in the new domain site the correct url is shown in the address bar, all I get is a 404 Not found message saying the requested URL is not on the server – what does this suggest, have I lost some files?

  • http://www.vaguerantproductions.com Chad McCanna

    I just executed this command through PHPMyAdmin after dealing with 2 days of phantom redirects… turns out all that was wrong is I forgot to change the URL. This solved ALL my problems. You have no idea what a godsend this blog was to me. THANK YOU!

  • http://www.aslifm.org radyo dinle

    hi @ all i need plug in for hosting for wp who can help me

  • Pingback: IP traumas at sliced moments

  • Pingback:   Me mudo al nuevo dominio elcofrecito.net by El Cofrecito

  • http://SpasticToilet.com Mark

    An easier way to replace all occurrences of your old domain name is to export your database into a text file using phpmyadmin or a backup plugin, then use a text-code editor to find and replace all occurrences of olddomain.com with newdomain.com.

    Import and voila!

  • Pingback: dreamluverz collection » Blog Archive » moving wordpress to another server

  • http://www.radyoplay.com radyo hosting

    thanks for sharing this howto

  • http://www.daylife.com housespeed

    they had the wild playing still there. work visit little done it. let it go. reminded damage the forests

  • Pingback: Changer le nom de domaine d’un blog sous wordpress

  • http://philippinedev.com Philippine Website D

    Thanks for sharing how to move WordPress blog to new domain or location.

  • G

    A really great help after moving my wp-installation. Made my day :) Thanks

  • http://www.wassupady.com wassup

    Thanks for this article.

  • soul

    this occured to me after moving from one webhost to another. i couldnt login as admin.

    tried alot of the cheap fixes but the cheapest of all worked:

    http://www.village-idiot.org/archives/2007/05/22/

    be sure to delete emergency.php after yer done!

  • http://www.tubatesmal.com Luís Reis

    Hey again! Forgot to mention that I also had to change links to images inside post content!

    Like this:

    UPDATE wp_posts SET post_content = replace(post_content,"http://somedomain.com/newdir&quot;,"http://somedomain.com/&quot;);

    The method is always the same, find the old link in the table fields and replace by the new one.

    Bye!:)

  • http://www.tubatesmal.com Luís Reis

    To fix images path after moving wordpress to another domain or directory you need to update wp_postmeta and wp_posts so that every link related to posts link to the new wp_content location. We need to do a find and replace in some tables of the database. Using phpMyAdmin You could use the following SQL code to search and replace de links.

    UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring");

    One example would be:

    UPDATE wp_postmeta SET meta_value = replace(meta_value,"http://somedomain.com&quot;,"http://somedomain.com/newdir&quot;);

    UPDATE wp_postmeta SET meta_value = replace(meta_value,"http://somedomain.com&quot;,"http://somedomain.com/newdir&quot;);

    or the other way round depending on your case… (this was mine – changed to account root)

    UPDATE wp_postmeta SET meta_value = replace(meta_value,"http://somedomain.com/newdir&quot;,"http://somedomain.com&quot;);

    Note: You can use similar expressions to change links for "wp_posts" table, in this case the field to change is "guid".

    Note: In my case I had to Update Permalinks in WordPress Admin->Options->Permalinks to update global linking.

    IMPORTANT: Before changing any table fields look carefully at the field values of the tables in the database so you can decide what values to change.

    This solved my migration of wordpress because after changing files to the server account root directory everything was pointing to the old URL.

    Hope to help, I know what you guys are going through! I had this problem a few days ago.

    Sorry if my English let You down but I'm just a poor Computer Engeneering Student from Portugal :) Have a nice life! Peace!

  • Pingback: Kevin Inscoe - The Morning Report » Blog Archive » Renaming your Wordpress 2.x blog to another domain name

  • Samuel

    i disabled all plugins, and the site worked again. maybe this helps. bye

  • http://ridingabuttertub.com The Ud

    You rock and fixed my site. Gracias.

  • http://www.1siliconvalley.com Steve Leung

    These SQL statements made my day a lot easier. Thanks!

  • Samuel

    hey, i followed these instructions, but wordpress now just wont display anything. i get a white page when opening index.php… anyway, i can display single pages with example http://url.com/wordpress/?p=123

    strange is that i won't find any php errors, httpd errors or anything alike. any suggestions?

    samuel

  • http://www.truebluetitan.com Rob Schultz

    Thank you so much for the above instructions. You just saved me a lot of time! Much appreciated.

  • Pingback: » And we're back! TechNest: The TechNest — The personal blog of Alex Luft

  • Pingback: » Welcome! Here we go! Alex Luft: Just another WordPress weblog

  • http://washed.ca Kevin

    THANKS!!! I thought I screwed things up royally by trying to organize my domain (and my life). This saved me.

    Cheers

  • Pingback: Technomestique » Blog Archive » Déménager son blog WordPress…

  • http://www.redowl.ca Jon-o Addleman

    Thanks so much for this! I can't believe this info isn't on http://codex.wordpress.org/Moving_WordPress already! I've been suffering through all sorts of 404's ever since following those instructions!

  • http://www.increased-online-traffic.com SEO Rob

    What's wrong with using the builtin Export-Import functions and then just install a plugin to redirect the URLs?

    http://rmarsh.com/2006/09/23/moving-your-blog/