Changing your domain name while keeping the same hosting account is one of the more nuanced WordPress tasks, the files stay put, but the database is full of hardcoded URLs that all need updating. Get this wrong and you end up with a site that loads on the new domain but has broken images, redirecting loops, or mixed content warnings.
WordPress stores the site URL in two places in the database: the siteurl and home rows in the wp_options table. Beyond that, every image URL, internal link, and serialised widget setting in the database that references the old domain also needs updating. A manual edit of wp_options alone is not enough, you need a proper search-and-replace across the entire database.
You also need to update wp-config.php if you have hardcoded domain values there, set up a 301 redirect from the old domain, update your SSL certificate, and notify Google Search Console. Each step matters for both functionality and SEO.
If you can still access the WordPress admin on the old domain, go to Settings > General and update both the WordPress Address (URL) and Site Address (URL) fields to your new domain. Save changes. WordPress will immediately try to redirect you to the new domain, have the new domain pointing to the same server before doing this, otherwise you'll lock yourself out of the admin.
If you're locked out, you can set these values directly in wp-config.php by adding the following two lines above the "That's all" comment:
define('WP_HOME', 'https://newdomain.com');define('WP_SITEURL', 'https://newdomain.com');
These lines override whatever is stored in the database and let you get back into the admin. Remove them once the database values are corrected.
The most reliable tool for this is Search Replace DB by interconnect/it (available free at github.com/interconnectit/Search-Replace-DB). Download the script, upload the folder to your server's public_html directory, and visit it in a browser. Enter your old domain in the search field and new domain in the replace field, select your database tables, and run a dry run first to see what would change.
Crucially, Search Replace DB handles PHP serialised data correctly, something a simple SQL REPLACE() query does not. Serialised strings store character counts, and replacing a URL of a different length without updating those counts corrupts widget settings and theme options. The tool recalculates lengths automatically.
Once satisfied with the dry run results, run the live replace. For a typical WordPress site this takes a few seconds. Delete the Search Replace DB folder from your server immediately after use, it has no authentication and anyone who finds it can modify your database.
Permanent 301 redirects tell search engines that your content has moved. Without them, Google will eventually treat the old URLs as gone and stop passing link equity to the new domain. Add the following to the .htaccess file on the old domain (or create a standalone redirect rule if you're keeping both domains on the same hosting account):
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
This preserves the URL path structure, so olddomain.com/about/ redirects to newdomain.com/about/ rather than just the homepage. Keep the old domain and these redirects in place for at least 12 months. Dropping them early loses accumulated SEO value.
Your existing SSL certificate covers the old domain. The new domain needs its own certificate. If you're using Let's Encrypt via cPanel (AutoSSL), navigate to SSL/TLS Status in cPanel and run AutoSSL, it will automatically issue a certificate for any domain pointed at your account. This usually takes a minute or two.
If you're using a paid SSL certificate, you'll need to reissue it for the new domain through your certificate provider. Until SSL is active on the new domain, visitors will see a browser security warning, so sort this before promoting the new URL anywhere.
Google Search Console does not automatically follow domain changes, you need to tell it. In Search Console, open the old domain property and use the Change of Address tool (found under Settings). This submits a formal domain change signal to Google and accelerates how quickly the new domain inherits the old one's search presence.
You also need to add the new domain as a separate property and verify ownership. Submit an updated XML sitemap from the new domain immediately. Expect rankings to fluctuate for two to four weeks while Google recrawls and reassigns link equity, this is normal.
If you use an SEO plugin like Yoast SEO or Rank Math, the plugin generates canonical tags dynamically based on the current site URL. Once you've updated siteurl and home in the database, these tags will automatically point to the new domain, no manual changes needed in most cases.
However, if you have hardcoded canonical tags in your theme's header.php, or in page/post meta fields, those need updating manually. Use your browser's View Source on a few key pages and search for rel="canonical" to confirm everything is pointing to newdomain.com. Any remaining references to the old domain are signals you missed in the search-and-replace step.
Before announcing the new domain, work through this checklist: confirm SSL is active (padlock in browser), check five to ten internal links manually, submit the new sitemap to Google Search Console, verify that the old domain redirects correctly, and test any forms or checkout flows that send emails, some email plugins hardcode the domain in the From address and need updating.
Also update any external references you control: your Google Business Profile, social media bios, email signatures, and any backlinks you can reach. These won't affect the migration itself, but they affect how quickly traffic consolidates on the new domain.
We migrate WordPress sites for free. Our team handles the technical side so you can focus on your business.
View Hosting Plans