In this article we’ll explain how you can change the domain your WordPress website is using.

Before you start please ensure you have completed the following:

  1. Register your new domain name
  2. Add your domain to your Ecenica web hosting. See How-to add a Domain Alias

Steps to change the domain your WordPress website uses

  1. Login to your WordPress Dashboard
  2. From the left menu click Settings > General
  3. Change WordPress Address (URL) and Site Address (URL) to your new domain.
  4. Scroll down and click the blue Save Changes button.

How to use WP-CLI to update WordPress post content to use the new domain

  1. Log in to cPanel
  2. Click Terminal
  3. Run the following command. The ‘dry-run’ flag will not make changes.
    wp search-replace '' '' --dry-run
  4. If you are happy, remove ‘dry-run’ by running the command below.
    wp search-replace '' ''