WordPress is the world’s most preferred website building platform and for good reason. It is very easy to set up and highly customizable. We at BlogVault came across a situation where we had to change the website URL. We wanted to change the domain name of one of our websites. Thankfully there are more than one ways in which WordPress enabled us to change WordPress site URL.

WordPress provides two configurable website URLs – WordPress address (also called SiteURL) and Site address (also called HomeURL). WordPress relies on these URLs to access your WordPress files and load the content correctly onto your website. Generally, the two addresses are filled out by default when you create a WordPress website. To change the URL of a WordPress website, you need to modify both the WordPress address and Site address URL.

There is a lot of confusion when it comes to understanding what WordPress address and Site address does, and why there are two addresses instead of one. In this article, we aim to demystify these URLs and give you an understanding of how to modify them.

 

General settings WordPress Address

[toc]

What is the difference between Site Address & WordPress Address?

 

Site Address –

To put it simply, Site Address is the address visitors type in their browser to reach your WordPress blog.
For instance: Look at the URL of this blog: https://westworldfansite.com. This is the Site Address.

Site Adress Url Example

 

WordPress Address –

WordPress Address is the address where your WordPress core files reside. At the time of building this website, WordPress files were automatically stored in specific locations. (For instance, all WordPress plugins are located in the Plugins folder, look at the image below)

Now if you try to automatically change the default location of the WordPress install, the WordPress Address URL will change.

WordPress Address URL change

 

For instance: The URL of this is blog is https://westworldfansite.com. By default, this is also our WordPress Address. To access the Admin dashboard of our blog we visit: https://westworldfansite.com/wp-admin/.

Now if we decide to move WordPress install to a new WordPress directory called “FolderX”, then the WordPress Address would be https://westworldfansite.com/folderx. To access the Admin dashboard, we’ll go to https://westworldfansite.com/folderx/wp-admin.

Now that we have a better understanding of the WordPress address and the site address URL, let’s take a look at how you can change them.

 

How to change WordPress site URL?

There are multiple ways to change your site URL. In this article, we’ll discuss three of them.

  • Change the WordPress URL from Admin Dashboard
  • Change the WordPress URL from the wp-config.php file
    • Change URL from wp-config using File Manager
    • Change URL from wp-config using an FTP client
  • Change the WordPress URL directly in the database

 

Note that in order to change the WordPress site URL you’ll have to change both the WordPress address (SiteURL) and Site address (HomeURL).

Change URL from Admin Dashboard:

You can modify the URL values from the WordPress dashboard.

Log in to your website. Navigate to Settings and then General.

Dashboard Settings General Options

 

In the General page, you should be able to see two options: WordPress Address and Site Address. Go ahead and change them. Don’t forget to hit Save Changes.

General settings WordPress Address

If you are trying to access your site using the new URL but facing an error, it’s very likely a cache issue. Clean your cache using a plugin. Here a guide to the Best WordPress Caching Plugins.

 

Change the URL from the wp-config.php file:

Besides the admin, another way you can change your WordPress URL is from the wp-config.php file. Editing the wp-config file is risky if you are not familiar with the WordPress environment. Changing the site URL from the Admin Dashboard would be a safer bet. But if the URL fields in the General page is not editable, you’ll have to resort to editing the wpconfig.php file.

It’s important to note that modifying the file may cause errors or even break your site if it’s not done correctly. Therefore, take backups while changing your site address. So that if disaster strikes you can always restore your site back to normal.

One can access the config file in two ways:

  • From the File Manager
  • From an FTP Client

We’ll discuss both of them.

 

Change URL from wp-config using File Manager –

To access the config file, go to your web host account and navigate the to cPanel. From the cPanel, select File Manager.

cPanel File Manager option

The file manager looks like this (view the image below):

file manager folders preview

 

From the left side of the file manager, select the root directory, i.e. public_html folder. As soon as you click on the folder, the content of the public_html folder appears on the right. In there, you should be able to find the wp-config.php file.

wpconfig file located in public html

 

After finding the config file, right click on the file and select Edit. It’ll take to new tab from where you can edit the config file. Now, simply insert the two following sentences at the beginning:

(Remember: If you have SSL certificate installed then, use https in front of the URL.)

define('WP_HOME','https://westworldfansite.com');

define('WP_SITEURL','https://westworldfansite.com’);

 

editing wpconfig config file

 

If your WordPress address is not the same as Site address, then the input text would look like this:

define('WP_SITEURL','https://westworldfansite.com/folderx');

define('WP_HOMEURL','https://westworldfansite.com’);

 

Select Save Changes and then exit the page. Now trying typing out your new domain name in the address bar to check if you have successfully changed WordPress site URL.

 

Change URL from wp-config using an FTP client –

 

There are several FTP clients to choose from. For the purpose of this article, we are using FileZilla.

Open FileZilla and enter your FTP hostname, username, password and port number and then click on Quickconnect.

filezilla login for quickconnect

Once FileZilla connects with your web host, you’ll see the folders of your website appearing on the right side of your FTP client (see image below) under Remote site.

 

ftp client remote site folders

 

Select public_html folder. As soon as you select the folder, the content of the folder will appear under the section Filename. You should be able to find the config file in there.

locate wpconfig file in public html

Right click on the wp-config.php file and select Edit/View.

Insert the two following sentences at the beginning:

define('WP_HOME','https://westworldfansite.com');

define('WP_SITEURL','https://westworldfansite.com’);

 

wpconfig file editing

If your WordPress address is not the same as Site address, then the input text would look like this:

define('WP_HOME','https://westworldfansite.com/folderx');

define('WP_SITEURL','https://westworldfansite.com’);

 

Save the file and then exit from the file by clicking on the cross sign at the corner of the window.

FileZilla will immediately tell you:

“A file previously opened has been changed. Upload this file back to the server?”

Select Yes

click yes to confirm changes

And that’s it.

 

Change URL via the database –

Another way of changing WordPress URLs are via phpMyAdmin database.

Before proceeding, it is important to note that modifying the Database may cause errors or even break your site if it’s not done correctly. This is why it’s advisable that you take WordPress backups while changing the URL. So that, on occasion of a misfortune, you can always restore your site back to normal.

To access your WordPress database, go to your web host account and navigate the to cPanel.

cPanel phpMyAdmin

 

From the cPanel, select phpMyAdmin. When phpMyAdmin opens, it looks like this (view the image below):

phpMyAdmin preview

 

In the phpMyAdmin, select the database of your website from the left-hand side. (Our database has a different prefix hence, it looks like this) Then scroll down and select the wp_options table. In this example, our database table prefixes have been changed from wp_ to 67e_. We’ll look for 67e_options.

When you click on the options table, a new page appears. In that page, you’ll find these two options: siteurl and home.

 

siteurl and home option name

You can edit both home and siteurl by clicking on Edit.

edit home and siteurl

Replace the URLs and don’t forget to hit Go when you are done.

replacing urls example

 

Remember to replace your old site URL with the new site URL in both site and home url.

replacing old site url with the new site url

 

Over to you

We hope you have found this guide easy to follow and would love to hear from you if you have any suggestions. Before leaving we’d like to remind you that although changing the WordPress site URL is straight forward, one must proceed with caution.

You need a safety net to fall back on when things go south!

Try BlogVault Backup Service right now.