Changing Domain with WordPress

Originally this site used the hfz.io domain. I bought the domain over at Gandi.net, which I found to have the lowest price for .io (39US$ at the time). The problem came a few months later when I tried to renew the domain.

As it turned out, .io domains could not be renewed at any time. Instead, domain owners are given the chance to renew starting from one month before the domain expires. I understand that there are some business reasons why this is so, but this is annoying from a customer standpoint. The limited renewal time window is worrisome because there’s a possibility that I miss the notification; this had happened before with an old domain of mine. Additionally, the domain can only be renewed for a maximum of two years in the future. This makes it a bit more complicated if I want to keep the domain for a long time.

Then I realized that I had an unused .im domain laying around, and decided to use that instead. .im’s are cheap, can be renewed at any time, and is just as short.

The domain change process itself was relatively simple. First, as I’m using Webfaction, it was easy to point a new domain to the same WordPress install. Add a simple DNS change and done. After waiting a day for the DNS to propagate, both hfz.im and hfz.io pointed to the same WordPress install.

The Codex gives four options to do a URL change. The one with wp-config.php is pretty simple, but it hardcodes values to the site and I didn’t want to do that.

The function.php method is silly (“So, you use your theme to change the URL of your site?”). It’s a bit hack-ish to load the site once and only once for the function to work, and make sure to delete it afterwards before someone loads the site and triggers the function again. I ended up using this method, though, because I knew what I was doing and the site was not getting any traffic during the process.

Afterwards, everything was running normally.

Just to be safe, I used Velvet Blues Update URLs plugin to seek-and-replace any instance of hfz.io to hfz.im. That’s about all I did to move my site to another domain name.

For a big site there might be more works that needs to be done. Like redirections, to ensure that the site’s search engine rank is preserved and that visitors with old bookmarks don’t get stranded. My site is a very young, low-traffic site, though, and traffic is not important. It’s likely that this site will have to start over SEO-wise, but that’s fine.