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.

IMPORTANT: The page is machine translated and provided "as is" without warranty. Machine translation may be difficult to understand. Please refer to original English article whenever possible.

  • Using PHP-MySQL Persistent Connections to Run WordPress Blog
  • Replace Google Blog Search with Technorati for Incoming Links in Dashboard of WordPress
  • WLWManifest Disabler Plugin to Remove XLM Link in WordPress Blog Header
  • AdSense and Display Banner Ads Rotation in WordPress Blog or Websites
  • How to List and Show WordPress Posts That Comments and Pings Off (Not Allow)
  • Moderate WordPress Blog Comments Via Moderator with Desktop Client
  • How to Rename or Move Oracle Tablespace Datafile to Another Location
  • Google Domain Names Registration and Search for Free Apps for Your Domain
  • Integrate and Display Google AdSense for Search and Co-Op Custom Search Engine Results in WordPress Blog Page Template
  • How to Delete Existing WordPress Post Revisions Stored/Saved

167 Responses to “How to Move WordPress Blog to New Domain or Location”

Pages: « Previous 1 2 3 4 ... 7 Next »

  1. The Forgettful Website Developer » Blog Archive » Moving a WordPress website to a new host
    September 17th, 2008 05:01
    50

    [...] moving wordpress site [...]

  2. Mudanza del blog | Thuer.com.ar
    September 17th, 2008 00:37
    49

    [...] Mover un blog en Wordpress a otro dominio: “How to Move WordPress Blog to New Domain or Location“ [...]

  3. mirosol
    September 16th, 2008 21:24
    48

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

  4. How to move wordpress blog to new domain or location - Drosophila Genetics and Epigenetics
    September 12th, 2008 04:34
    47

    [...] case of need, THIS can really helps ! This entry was written by Christophe, posted on September 11, 2008 at 10:34 [...]

  5. WordPressのURL移転時の内部リンク書き換え方法覚書 - SharpLab.
    September 10th, 2008 13:48
    46

    [...] バイトで必要になったので調べた。How to Move WordPress Blog to New Domain or Location » My Digital Lifeというエントリが参考になる。 [...]

  6. cathy lopez
    September 9th, 2008 00:23
    45

    You just save my life! lol!
    Thanks for your article.
    It worked great! No fuzz!

  7. Welcome to c64glen.com at C64GLeN - The blog of Glen McNamee
    August 24th, 2008 07:39
    44

    [...] database across, and after a few little changes here and there (wordpress plugins and a few little database changes) all was [...]

  8. Smuggle Me » Export One Wordpress Blog Category to Create a New Blog
    August 17th, 2008 10:38
    43

    [...] Once you have uploaded the posts to the new blog, you’ll also want to consider running the following 2 queries as suggested here: [...]

  9. Piotr
    August 10th, 2008 05:26
    42

    great info :)

  10. How to move WordPress blog from old domain to new domain with 301 permanent redirection - SEO / SEM blog
    August 6th, 2008 18:00
    41

    [...] SQL codes from mydigitallife.info SHARETHIS.addEntry({ title: “How to move WordPress blog from old domain to new domain with 301 [...]

  11. Ken Hung
    August 3rd, 2008 21:45
    40

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

  12. NAthanT
    July 30th, 2008 15:56
    39

    Gold information.

    You saved me hours.

    Cheers

  13. We’ve Moved… Everything Must Go! : Foo Kabloo!
    July 22nd, 2008 11:08
    38

    [...] http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/ [...]

  14. Designer-WG » Blog Archive »
    July 14th, 2008 20:18
    37

    [...] I’ve posted this comment to the mydigitallife.info [...]

  15. Simon
    July 14th, 2008 20:04
    36

    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

  16. rebel
    July 9th, 2008 13:38
    35

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

  17. Nikhil George
    July 1st, 2008 14:18
    34

    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…..:)

  18. ——Sahil Seth dot com—— » Back again…
    June 26th, 2008 22:20
    33

    [...] the first thing to be done was to get hold of all the old posts (though very less in number). Here google served as a saviour and I got hold of a plugin called ‘wp-migrate‘, which let me export all the posts along [...]

  19. Phil
    June 19th, 2008 03:48
    32

    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.

  20. Rhett Soveran
    June 16th, 2008 08:30
    31

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

  21. scriptygoddess » Blog Archive » Moving a Wordpress Install
    June 15th, 2008 05:29
    30

    [...] all their sites to the new site. Some of these sites were wordpress powered. Thankfully, I found this article that made the move a [...]

  22. Worcester NO2ID
    June 14th, 2008 02:09
    29

    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!

  23. Stuart
    June 10th, 2008 00:26
    28

    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?

  24. Chad McCanna
    June 9th, 2008 03:03
    27

    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!

  25. radyo dinle
    June 2nd, 2008 15:34
    26

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

Pages: « Previous 1 2 3 4 ... 7 Next »

Leave a Reply

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

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.

New Articles

  • VIA Nano Based Epia M800 and N800 Platforms Targeted for Embedded World
  • Pikavu Express Locator Helps Protective Parents To Track Kids' Location
  • MSI X-Slim X350 With Unique Diamond-Motif Etching Technology
  • Kindle For iPhone App Free Download For Customers In Over 60 Countries
  • Hidden Wonders of the Depths (Windows and Mac) Free Game Download
  • Sony Ericsson Xperia Pureness Available In United States For $990
  • Treasure Seekers: Visions of Gold Free Big Fish Games Coupon Code for Full Version Download
  • ViewSonic VNB102 Netbook With Windows 7
  • Free iRobot Roomba 500 Series Side Brush
  • Kaspersky Security Suite CBE Win7 (KIS 2010) Free Download with Activation License Key

Incoming Search Terms for the Article

moving wordpress - move wordpress blog to new domain - move wordpress - migrate wordpress - move wordpress to another domain - wordpress move domain - Moving WordPress to a New Server - how to move wordpress - migrate wordpress to new domain - migrating wordpress - how to move wordpress blog to another domain - wordpress change domain - move wordpress to new domain - move wordpress domain - moving wordpress blog to new domain - moving wordpress to a new domain - wordpress move - wordpress migrate - move wordpress blog - change wordpress domain - wordpress domain change - migrate wordpress to new server - moving wordpress blog - moving a wordpress blog to a new domain - wordpress new domain - wordpress domain - change domain wordpress - how to move a wordpress blog - wordpress migrate to new domain - moving a wordpress site - moving wordpress to new domain - how to move wordpress to another domain - migrating wordpress to new domain - move wordpress to new host - moving a wordpress blog - how to move wordpress to new domain - how to move wordpress to a new domain - moving a blog - how to move wordpress blog - wordpress blog - how to move a wordpress site - blog Name (required) - wordpress change domain name - how to move my wordpress blog - moving wordpress to new host - wordpress migration new domain - wordpress move blog - move wordpress new domain - how to move wordpress blog to new host - migrate wordpress domain -
  • Recent Comments:

    • ibheck: with this sofware we can reduce manage our image, wonderful tool on Free FILEminimizer Pictures License Serial Key Giveaway (To Reduce Image Size)
    • affordable webhosting: How much for the nice article? Really enjoyed reading this and will check back again. Many thanks friend! on Free Web Hosting with PHP Support
    • sanjay: i am sanjay S/o vijay jai inter net cafe wadi(Jn) 585225 on Samsung TL100 Ultra-Slim 12.2-Megapixel Digital Camera With New Smart Auto Feature
    • yb3td: links is not working. google delete all of old versions toolbar. now only google toolbar 5 and up available for ... on Download Google Toolbar 3.1.20080605W for Firefox 3.0 Support
    • senthil: can u help me.Is there any mobile app. to make calls to singapore @ free of cost. on Unlimited Free Calling to US, UK, Canada, China, Singapore, Hong Kong, Taiwan and Australia with MediaRingTalk.com
    • Antoine: Hi, Can you send me the product key Thanks Vivredifferement@gmail.com on Microsoft Office 2010 Technical Preview 1 (Beta v14.0.4006.1010) x86 and x64 Leaked Download
    • Antoine: Hi, Can you send me de product Key? Thanks on Microsoft Office 2010 Technical Preview 1 (Beta v14.0.4006.1010) x86 and x64 Leaked Download
    • john smith: send me the key thanks on IP Hider 3.7 6-Months Serial License Key Free Download Giveaway (Proxy Changer)
    • Mike Bouchard: Such compression while keeping quality ! I really need it because I am stuck with dial-up (live too far ... on Free FILEminimizer Pictures License Serial Key Giveaway (To Reduce Image Size)
    • kevin: pls sen me a key on IP Hider 3.7 6-Months Serial License Key Free Download Giveaway (Proxy Changer)
  • Meta

    • Log in