How to change the WordPress home and site URL settings

If you moved your WordPress site from another host or want to move your current installation to another directory, you’ll need to change the WordPress address and site address. These two settings are usually the same, but can sometimes be different. For example, if you’ve installed the core application files in a subdirectory instead of the root directory.

  • WordPress address (wp_home) – This is the address of your core WordPress application files.
  •  Site address (wp_siteurl) – This is the address your site visitors enter in their browsers to view your site.

Changing the WordPress address and site address

There are two ways you can change these settings – in the WordPress dashboard or by modifying your wp-config.php configuration file.

Changing settings in the WordPress dashboard

Using the WordPress dashboard is the easiest and safest way to change your home and site URL settings. Log in to your WordPress dashboard and go to Settings General.

In WordPress Address (URL), enter the location of your core WordPress application files. In Site Address (URL), enter the address of your public WordPress site. In our example, the core application files (WordPress Address) are installed in a subdirectory called wp and the site address is the root directory. Click Save Changes.

Changing settings in wp-config.php

Note: If you choose to change your WordPress address and site address in wp-config.php instead of in the WordPress dashboard, the WordPress Address (URL) and Site Address (URL) settings in the dashboard will be disabled.

Before you edit your wp-config.php file, you should understand that even a small error in the file could make your WordPress site inaccessible. For this reason, we strongly recommend that you make a copy of the existing wp-config.php file before you make any changes.

There are two methods you can use to edit the wp-config.php file:

In this example, we’re editing the file in the cPanel File Manager.

Copy and rename the wp-config.php file

Log in to your HostPapa Dashboard and go to cPanel > File Manager. In the root folder of your WordPress installation, locate wp-config.php. Right-click and select Copy.

In the Copy dialog box, type a descriptive name for the copy of the file and click Copy File.

Edit the wp-config.php file

In File Manager, right-click wp-config.php and select Edit. In the Edit dialog box, click Edit.

The file opens in the File Manager editor. Near the top of the file, add the following lines, replacing example.com with your domain name. WP_HOME is the location of your core WordPress application files and WP_SITEURL is the address of your public WordPress site. When you’re finished, click Save Changes and Close the file.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

In our example, this section of our wp-config.php file now looks like this:

Test your site by visiting the home page and logging in to the dashboard. If there are any errors, restore your original copy of wp-config.php and contact HostPapa support for help.

More information

For more information, see How to edit your WordPress wp-config.php file and How to transfer my WordPress site to HostPapa in the HostPapa WordPress knowledge base.

If you have any questions or need help, you can always contact HostPapa Support by opening a support ticket. Details about how to open a support ticket are here.

Was this article helpful?

  • Was this article helpful ?

  • yes   no

Related Articles

Leave A Comment?