Casbay Knowledge Base

Search our articles or browse by category below

HOW TO: Configure WordPress to work with a new domain

Last modified: October 1, 2022
Estimated reading time: 1 min

HOW TO: Configure WordPress to work with a new domain

Using WordPress Admin Dashboard

First, go to Settings > General and replace your WordPress Address and Site Address with your new domain name.

  • The “Site Address (URL)” setting is the address that your visitor need to type in their browser to reach your WordPress blog.

  • The “WordPress Address (URL)” setting is the address where your WordPress core files located.
  • Using File Transfer Protocol (FTP)

    If you have FTP access to the website, you can get your site back up and running quickly with wp-config.php and functions.php if you changed those values incorrectly in the WordPress Dashboard.

    Edit wp-config.php

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

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

    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');
    **This is not necessarily the best fix, it’s just hardcoding the values into the source code of the site. When using this method, you won’t be able to edit them on the general settings page anymore.

    Edit functions.php

    1. Download a copy of the active theme’s functions.php file. You can edit it in a simple text editor and reupload to the site.

    2. Add these lines to the file, right after the initial “<?php” line.

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

      *Remember to replace the example.com with your own URL .
    3. Re-upload the file to your site in the same location.

    4. Load the login or admin page for a few times. The site is supposed to return.
    Read the next article: How to Change your Header in WordPress.
    Was this article helpful?
    Dislike 0
    Previous: WP Super Cache Plugin
    Next: HOW TO: Configure the WordPress permalink structure