The scenario
These moves can be really dependent on the scenario you are dealing with, for example: who has the domain registered etc., so I’m just going to detail what I did and hopefully it will help others.
In order to keep the bodies buried, I’m not going to use the real domain names. In this case, the client had a main site on Weebly (which BTW seems like a reasonable site builder tool) which we will call: www.gooddomain.com and her WordPress blog on blog.olddomain.com. The goal was to move the blog to blog.gooddomain.com so that she could have a consistent brand while delaying the expense of combining the Weebly site into her WordPress site. To add a bit to the complexity, each of the domains were registered with two separate registrars. So the players in this case were the two registrars: GoDaddy, Epik, and the two sites: SiteGround and Weebly.
We were not moving hosting for the blog, just the domain to the gooddomain.com domain. I had previously extracted the site from a shared Dreamhost account and took advantage of SiteGround’s free WordPress site transfer deal to get her site moved for a low cost. Yes that’s an affiliate link, but it really is a great deal.
Moving a WordPress Domain in 7 Steps
Here’s how I did the move:
- Backup Everything: Plenty has been written about how to backup a WordPress site so I won’t cover that here. When I do a full backup, I do three things: 1) Export the database out of phpmyadmin, 2) Export the site using WordPress Tools -> Export, 3) Download a complete copy of all the files via FTP. Overkill? Maybe, but better to be safe rather than sorry.
- Create a pointer for the new blog subdomain: Epik already had an “A” record for the main site for the Weebly IP, so I created another “A” record for blog.gooddomain.com that pointed to the SiteGround IP for the site. Then I went offline and did some other things for a couple of hours to let the DNS record propagate.
- Change primary domain: SiteGround provides an easy way to change the domain of the primary site, it’s literally a single click of a button and filling in two fields. With other hosting providers you may have to submit a ticket.
- Make WordPress aware of the change: There is a number of ways to do this. I chose to add two lines at the end of the wp_config.php as below (note that you have to ftp/upload the file or log into the server to do this):
define('WP_SITEURL', 'http://blog.gooddomain.com');
define('WP_HOME', 'http://blog.gooddomain.com'); - Change old domain references in WordPress: Now you have the problem of having lots of references to the old domain in image embeds, links, menus and more. Fortunately, like with a lot of things WordPress, there is a plugin to help. I first tried the Velvet Blues Update URLs plugin, however it did not update the media library. So I then installed the Better Search and Replace WordPress plugin and with that, and a bit of manual tweaking I had a working WordPress site under the new domain.
- Redirect the old domain: If your old domain has any backlinks to it, this is an important step, you want your visitors (and GoogleBot) to get to the new domain. The “olddomain” was registered with GoDaddy, so I added an additional forward for blog.olddomain.com to blog.gooddomain.com. (see note about GoDaddy forwards below)
- Update main site to reference the new blog domain: There were a few external links in Weebly that pointed to the old blog domain, so I updated those.
GoDaddy’s 302 Redirect Problem
Ostensibly because “..the redirects work to maintain the integrity of the server”, GoDaddy sticks a 302 redirect in front of the 301 redirect. This has been a long standing problem with GoDaddy that they will not address. Here’s a workaround from a SEO company: Godaddy botched their 301 redirection now what. However, Google is pretty smart, so the impact could be small. We are going to watch and see how badly it affects the new domain, and possibly move the domain to a new registrar if it proves to be a problem.
Do you have a guide in regards how to use the plugin Search and replace? It’s quite confusing for me. That’s why I’m asking.
Have you taken a look at the plugin documentation?