How to Change the Domain of Your WordPress Website

Sometimes a rebrand becomes necessary – and that includes changing your website's domain. Whether you are introducing a new brand name, renaming your company or have simply found a better domain: a domain change is a technically sensitive process that needs careful planning. The following step-by-step guide takes you through the process safely.
Step 1: Create a backup
Before you change anything, create a complete backup of your website – both the files (theme, plugins, uploads) and the database. If something goes wrong, the backup is your only way to restore. Store the backup in a safe, external location.
Step 2: Register the new domain
Register the new domain with a reliable domain registrar. Make sure the nameservers point correctly to your hosting provider and that the domain is already active and reachable before you continue with the next steps.
Step 3: Add the domain in the hosting panel
Add the new domain in your hosting control panel (e. g. cPanel) as an addon domain. Set the document_root to the public_html directory of your existing WordPress installation so that both domains access the same files.
Step 4: Update URLs in the database
WordPress stores the old domain in numerous places in the database. Open phpMyAdmin or use a WP-CLI command to replace the old URLs with the new ones – in particular in the tables wp_options (siteurl, home), wp_postmeta and wp_posts. The WP-CLI command wp search-replace 'https://alte-domain.ch' 'https://neue-domain.ch' --recurse-objects --skip-columns=guid is particularly helpful here.
Step 5: Set up redirects
Set up 301 redirects in the .htaccess file that permanently redirect all requests from the old domain to the new one. A 301 redirect signals to Google that the move is permanent and transfers the SEO value (link juice) of the old pages to the new URLs. Test every important URL to make sure the redirects work correctly.
Step 6: Notify Google Search Console
Add the new domain to Google Search Console and verify ownership. Then use the “Change of address” function in the settings of the old domain to officially inform Google about the domain change. Verify ownership of both domains in the process. Google will then gradually switch the index over to the new domain.
Conclusion
A domain change is not a trivial process, but with the right preparation and a clear step-by-step approach it can be carried out without problems. Backup, new domain, database update, 301 redirects and notifying Search Console are the six decisive steps for a smooth and SEO-friendly domain change.
