Hey guys! Welcome to another #WordPressWednesday. This one is actually exciting because it’s something I’ve never done before and learned how to do over the weekend. Currently, I’m working on a new blog site (shameless plug) and over the weekend I decided I wanted to use a different URL for the site. So I brought the domain, got it configured and then had to figure out how to change over the URL. On normal sites, you can just go into the hosting server and have the new domain point to where the website is installed. But on WordPress it’s a little different. I’ll show you how it’s done.
A few important things to note before we get started:
– Make sure you perform a backup of your site before you make any changes (you should be backing up your site regardless – and I’ll show you how to do it in my next post).
– When you do this, your site will be down temporarily while the switchover occurs. The best time to do this is when you are having the least amount of traffic (on nights or weekends).
– Make sure your domain is setup and ready to go before you perform any of the steps outlined below.
– Lastly, make sure you follow the instructions carefully. One wrong slip up and you can end up not being able to recover your site!
So now that we’ve gotten that all out of the way, let’s get started!
Change Domain name in WordPress
First thing you want to do change the domain name in WordPress. Log into your Admin Dashboard, go to Settings > General. In the WordPress Address and Site Address fields, change the address of your new domain and hit Save.
Note: If your original site used http, it’s best to have the new site under http as well. There are ways to force your website to work over https, but the easiest and convenient way to do it using the iThemes Security plugin. We’ll talk about https more in a future post.
Change Domain on hosting site
Now when you save the changes on your site, you are going to get an error and/or a blank page; don’t worry, this is normal. The changes are saved but it can’t load anything because the new domain isn’t valid yet. To make the domain valid, you will need to log into your hosting site CPanel and have the new domain point to the folder where your WordPress site is installed. Once you make the change, give it a few minutes to connect to your WordPress. Then, type in your new domain name, and your site should load successfully.
But wait, it didn’t work!
If you run into issues with getting the new domain to work or if you still can’t access the website after following the instructions, there is a way to revert the changes you made.
First, make sure the old domain is pointing to your WordPress folder.
Go into your CPanel and into PHPAdmin. Select your database from the left-hand side, and then on the right-hand side you want to look for “wp_options”
Click on it and you will see two fields: siteurl and home. Select edit and change the domain in both fields back to what it was before and hit Go (it’s MySQL speak for save). Give it a couple of minutes and the site should revert back to the way it was. If you can’t do these steps or have issues accessing your PHPAdmin, contact your hosting site for assistance.
And that’s it! Fun right? Now you know how to change your site’s URL. I hope you find this useful and I’ll see you next week!
P.S. My tech blog site nerdyandnatural.tech is launching soon! Keep an eye out for more details.