How to move a WordPress Website to a different domain

After various domain movements I figured I would like to reduce my efforts to just one way of moving a WordPress installation from one domain to another – not the quick and dirty, but the right way. IMHO the question remains anyways, if there is any right or wrong way to move a WrdPress Website at all – or if all ways are right, as long as you get the thing done.

Prepare and pack your WordPress Website / Stuff carefully

I’d like to compare moving a WordPress Website to moving a household: of course you can do it this or that way – but in the end it is clearly the easiest if you wrap everything up, put it into boxes, put labels on the boxes – and move it from A to B. Then unpack everything, unwrap everything – and enjoy your new home.

At first glace this might look a bit unpractical – sometimes you just want to skip the wrapping, throw everything in the van as it is and that’s that. But in the end planning, wrapping and packing will reduce the risk of having your precious record collection and/or database broken. And in the long run this might save you a lot of stress, time and money.

So a couple of years ago to move a WordPress Website I actually used to first download all the files and then uploaded it to the new domain. Then I would do a database dump of the related mySQL database – and uploaded the dump, rebuild the database and  to the new webspace and restore all data records. Although this might look handy at first, it turns out to be very unpractical.

If not only the wbspace changed, but also the URL, you will soon notice that any URL you try under the new domain will forward you to the old domain. So entering new-domain/contact will forward you to old-domain/contact and so on. While this is quite easy to fix (just change the entry for siteurl and home in the db table “wp_options” to your new-domain) it might happen that all internal urls are still pointing to old-domain/url-path… That means every WordPress Page and every Blog Post that contains links is likely to be corrupt. So that’s not very handy.

Export – Import – and Bob’s your uncle

Instead of the above mentioned method I prefer to do a clean WordPress install. Upload and install all the plugins and the actual WordPress theme – put all the ‘infrastructure’ in place. To relate to the apartment moving: move and install the shelves first.

Then do an export of all posts and pages from the old domain. You can do that by using the built in WorPress function under tools > export or by using an appropriate plugin. Then download the dump and upload it to your new webspace / new domain. Then import all the posts and pages under the new domain through tools > import.

In general WordPress can import data records from various different sources: Blogger, LiveJournal, RSS, Tumblr etc.  So after clicking ‘import’ you’ll first see various options for different source to import from. One of the options is for WordPress: “Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.” Following that link will either bring you directly to the upload/import page – or show you an option to install the import plug-in “WordPress-Importer” first.

Most things should be Äin place’ by now. But since WordPress has the (bad) habit to store internal links and links to images with the domain name, all those links are now still pointing to the old domain. But – there is of course a plugin for that: Better Search Replace lets you virtually find everything in your WrdPress-Database that you would want to find and replace. But since it is quite powerful, one should be rather careful using it. Another promising, probably a bit more streamlined plugin is  Velvet Blues Update URLs (which I haven’t tested myself yet).

This all might actually sound a bit complicated – but once you’ve done it once, it’s as easy as 1-2-3 – and Bob’s your uncle :)

301: Tell the world (or at least some bots) you’re moving

That’s about it? Not quite yet. Technically the website has moved – but how will the internet, the search engines, the outside world perceive this process? Worst case scenario: you dumped the old domain right after moving everything to the new domain – and never told anybody about it. So next time a search engine spider visits your old domain, all it will ever find is either an abandoned website or total emptiness. If you don’t let people (and bots) know you’ve moved, then nobody will know you have moved. The search engine spider then has no other option than reporting  “website abandoned” or “website deleted” – your website will drop from the search index – and you don’t want that.

If you’re like me, moving your website and keep your search engine ranking is what you probably actually want to achieve. So you should leave a note, where you and your content have moved – just as you would probably do in real life :) The easiest way of telling “everybody” is putting up a 301 notification. The 301 was just made for this and basically exactly this purpose – to get this one message across: “content has moved”.

To forward every visit to your new domain (under the same directory path) this would be the code snipped you need to place in a htaccess file on the root level of your old domain:

#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$$1 [R=301,L]

You’ll have to replace “” according to your new domain :)

tell google (and other link partners) where to find you

Last but not least you should probably contact google directly. If you happen to have a google webmasters account this is a rather easy process. You might want to delete your previous domain from the google index and register your new domain – along with xml sitemaps etc…

Ah – very last but not very least you should of course inform your link partners. The 301 redirect will do for some time, but after a while it might look a bit odd if people are simply redirected. And once you close down the old domain and the old webspace, also the 301 redirect will stop working. So you better be sure you get your link partners informed in time.

tell your readers you have moved (and why!)

And then you should probably also inform your users and/ or readers directly: write a blog post about your reasons to move, tweet about it, write a newsletter – whatever you preferred form of user interaction might be, now is the time to use it. It is probably the most crucial aspect of moving a domain, that your users understand your motives – so you should address them directly and explain your reasons – and they’ll understand.

Leave a Reply

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