Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Make WordPress work with a new domain name

This guide shows how to switch your WordPress site to a new domain without losing your content.

WordPress2 min read15 steps

What is a domain?

A domain is the name people type to find your site, like example.com. WordPress remembers its own address inside the database. If you change the domain, WordPress must learn the new address, or it will keep sending visitors to the old one.

Warning: This changes how your site loads. Take a full backup of your files and database first.

Before you start

  • Add the new domain to your hosting account. Point it to Hostvento if it is registered elsewhere. Your welcome email lists the details you need, or ask support.
  • Make sure the new domain opens your hosting. This can take some time to spread across the internet.

Method 1: Change it in the dashboard

Use this if you can still log in.

  1. Log in to WordPress.
  2. Go to Settings, then General.
  3. Change WordPress Address (URL) to the new domain.
  4. Change Site Address (URL) to the new domain.
  5. Click Save Changes. You may be logged out. Log in again on the new domain.

Method 2: Change it in wp-config.php

Use this if you cannot log in. The file wp-config.php holds your main WordPress settings.

  1. Open File Manager in your control panel.
  2. Open the wp-config.php file in your WordPress folder.
  3. Add these two lines above the text that says "That's all, stop editing".
    define( 'WP_HOME', 'https://newdomain.com' );
    define( 'WP_SITEURL', 'https://newdomain.com' );
    These lines force WordPress to use the new address.
  4. Save the file and try to log in again.

Old links may still sit inside your posts and images. A search-and-replace plugin can change them all.

  1. Install a plugin such as Better Search Replace.
  2. Go to Tools, then Better Search Replace.
  3. Type the old domain in the search box and the new one in the replace box.
  4. Select all tables.
  5. Tick Run as dry run first and click the run button. Check the result.
  6. Untick the dry run and run it again to save the change.

Final checks

  • Go to Settings, then Permalinks and click Save Changes.
  • Set up a redirect from the old domain to the new one.
  • Check that SSL works on the new domain.

Quick recap

  • Back up first, then point the new domain to your hosting.
  • Change the two address fields in Settings, General, or set them in wp-config.php.
  • Replace old links in your content and add a redirect.