Force WordPress to Use Your Domain Name in the Site URL

If you’ve started a new WordPress blog, don’t forget to change the URL setting in WordPress to reflect your domain name instead of your hosting account name. I just ran into that problem and had to edit the settings to reflect each of my domain names. Here’s the problem explained and how to fix it:

1. When you sign up for a hosting account, you usually sign into the control panel using your hosting account name and password. Most shared server hosting accounts allow you to run multiple sites on the same server.

2. Once you set up your hosting account, you then have to move your domain name(s) to the site. In the root directory you will set up a folder for each site. My site looks like this, for instance : root\brian . Brian is the folder that holds everything that pertains to brianmahoney.ca. When I was setting up the site using WordPress, the install program didn’t see my site as brianmahoney.ca, it say it as myname.myhostingcompany.com\brian  and that was the name that came up in the URL window when I would browse to the site.

3. Obviously, I didn’t want to advertise my hosting company and I wanted people to get to know my domain name, brianmahoney.ca.  At first I thought this was a problem with the hosting servers. Somehow, I felt, they had screwed up the directory structure. Oooops! It was my fault all along. Here’s how I fixed it.

4. In the settings menu on the left of the screen in WordPress, the first setting is ‘General’. On the right side you’ll see two URL settings. The first is for the folder where the files are stored. WordPress has to know how to find the files even though it’s in them already, right? The next URL setting is for the Site Address. This is what I had to change to https://brianmahoney.ca

Once I changed that, the hosting company’s name didn’t show up in my browser URL any more. Relief! This is what to do in WordPress, if you use another type of blogging software, you’ll have to root around the settings to find the spot where you can change the site URL so that it reflects your domain name.

That’s it! I hope I’ve helped you a bit. I had to figure this out on my own. Ah, it pays to be smart, right? Hahahaha.

directory structure on host server
This is how the directory structure looks on the host server.