Skip to content

Changing the Domain in WordPress

Sometimes you may need to change the domain name of your WordPress site—for example, when migrating to a new domain or rebranding. On ruachost.com, you can update your WordPress domain settings using the dashboard, WP‑CLI, or phpMyAdmin.

  • Rebrand your site with a new domain name.
  • Migrate to a different hosting environment.
  • Improve SEO with a more relevant domain.

Before making any changes, always back up your WordPress files and database. This ensures you can restore your site if anything goes wrong.

  1. Log in to WordPress as an administrator.

  2. Go to Settings → General.

  3. Update the following fields:

    • WordPress Address (URL) → Enter the new domain.
    • Site Address (URL) → Enter the new domain. ⚠️ If your site has SSL, use https:// instead of http://.
  4. Click Save Changes.

  1. Log in to your hosting account via SSH.

  2. Navigate to your WordPress installation directory.

  3. Run the following command (replace with your domains):

    Terminal window
    wp search-replace 'old.example.com' 'new.example.com'

✅ This updates all instances of the old domain in the database.

  1. Log in to cPanel (or your hosting control panel).

  2. Open phpMyAdmin → Select your WordPress database.

  3. Locate the wp_options table.

  4. Update the values for:

    • siteurl
    • home
  5. Save changes.

  • Visit your site with the new domain.
  • Check for broken links or hard‑coded URLs.
  • Set up redirects from the old domain to the new one to preserve SEO.
  • DNS propagation may take up to 24 hours.
  • Always ensure the new domain points to your hosting server before updating WordPress.
  • Consider updating your permalink structure and regenerating your sitemap.