How to configure WordPress to work with a new domain

If you want to use WordPress on a new domain, all you need to do is change the siteurl and home options in our WordPress Dashboard or via FTP.

How to change addresses via the WordPress Dashboard

Log in to WordPress via the HostPapa Dashboard. Go to Settings > General and replace WordPress Address and Site Address with the new domain name you want to use.

95798355

The Site Address (URL) setting is the address you want people to type in their browser to reach your WordPress blog.

The WordPress Address (URL) setting is the address where your WordPress core files reside.

How to change addresses via FTP

If you have access to the site via FTP, these methods will help you quickly get a site back up and running if you changed those values incorrectly in the dashboard.

How to edit wp-config.php

You can set the site URL manually in the wp-config.php file.

Add these two lines to your wp-config.php, where “example.com” is the correct location of your site:

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

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

45201246

How to edit functions.php

Edit functions.php

  1. Download a copy of the active theme’s functions.php file. You’re going to edit it in a simple text editor and upload it back to the site.
  2. Add these two lines to the file, immediately after the initial “<?php” line.

update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );

Use your URL instead of example.com.

35645986

3. Upload the file back to your site in the same location.

4. Load the login or admin page a couple of times. The site should come back up.

Note: Do not leave those lines in the functions.php file. Remove them after the site is up and running again. If your theme doesn’t have a functions.php file, create a new file called functions.php in a text editor and follow the above steps.  

If you need help with your HostPapa account, please open a support ticket from your dashboard.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache