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.
- Log in to WordPress.
- Go to Settings, then General.
- Change WordPress Address (URL) to the new domain.
- Change Site Address (URL) to the new domain.
- 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.
- Open File Manager in your control panel.
- Open the
wp-config.phpfile in your WordPress folder. - Add these two lines above the text that says "That's all, stop editing".
These lines force WordPress to use the new address.define( 'WP_HOME', 'https://newdomain.com' ); define( 'WP_SITEURL', 'https://newdomain.com' ); - Save the file and try to log in again.
Fix old links inside your content
Old links may still sit inside your posts and images. A search-and-replace plugin can change them all.
- Install a plugin such as Better Search Replace.
- Go to Tools, then Better Search Replace.
- Type the old domain in the search box and the new one in the replace box.
- Select all tables.
- Tick Run as dry run first and click the run button. Check the result.
- 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.