Now let’s dive into the technical steps. These instructions assume you’re keeping the same hosting provider and WordPress installation—just updating the domain name.
Step 1: Update WordPress Address and Site Address
After logging into your WordPress dashboard, go to:
Settings → General
Change the WordPress Address (URL) and Site Address (URL) from your old domain to the new one. Make sure to use the full path, including https:// if you have SSL enabled.
Once saved, WordPress will attempt to reload using the new domain. This may log you out immediately. You’ll need to log in again using the new domain to continue working on your site.
This basic step updates core URLs that define how WordPress loads resources and links pages. However, it doesn’t update content already embedded throughout the site.
Step 2: Update wp-config.php (If Required)
Some hosting setups override database settings with values hardcoded in wp-config.php. If you previously added those, you’ll need to update them now.
Access your site using FTP, SFTP, or cPanel’s File Manager, then locate the wp-config.php file in the root directory.
If these lines are present, update them:
php
define(‘WP_HOME’,’https://yournewdomain.com’);
define(‘WP_SITEURL’,’https://yournewdomain.com’);
Or, if they’re not there, you can add them just before the line that says /* That’s all, stop editing! */.
Adding this helps prevent any issues with WordPress loading improperly after the switch and ensures consistent behavior during migration or restoration.
Step 3: Update URLs in the WordPress Database
Even after updating the site URL, WordPress stores internal links, image URLs, and file paths that still reference your old domain. These need to be updated to reflect the new domain.
Use a Plugin for Search and Replace
Install plugins like Better Search Replace, Velvet Blues Update URLs, or WP Migrate DB to scan and update URLs across your entire database.
With Better Search Replace:
- Enter your old domain and new domain.
- Select all database tables.
- Run a dry run first to preview changes.
- Once confident, run the actual replacement.
These plugins ensure that embedded links, image paths, menu items, and shortcodes reflect the new domain structure without manual editing.
Manual SQL Queries (Advanced)
Developers can use phpMyAdmin or similar tools to run SQL commands that update records directly. Be sure to back up your database before executing queries.
This method is more precise but riskier if errors occur. Always test thoroughly on staging before applying to a live site.
Step 4: Set Up 301 Redirects
Redirects ensure visitors and search engines are guided from your old domain to the new one. This is essential for SEO, brand continuity, and usability.
Using .htaccess for Apache Servers
Modify the .htaccess file in the old domain’s root folder:
apache
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
This permanent redirect passes link equity and ensures that bookmarks, backlinks, and search engines correctly route users.
Using Hosting Panel Tools
If you’re using cPanel, Plesk, or DirectAdmin, look for a “Redirects” option in your dashboard. You can add a domain-wide 301 redirect with a few clicks—no code needed.
Redirects should remain in place for at least 6–12 months to allow search engines to reindex your site and visitors to adjust.
Step 5: Update Google Search Console and Analytics
Search engines need to be informed of the change to preserve rankings and crawl your new domain effectively.
Google Search Console
- Add the new domain as a new property.
- Verify ownership using DNS, HTML, or GA methods.
- Use the Change of Address Tool under settings in your old domain’s property to notify Google.
Google Analytics
Log in to Google Analytics Admin settings. Under “Property Settings,” update the Default URL to your new domain. This ensures accurate tracking and attribution going forward.
Also, consider setting up Google Tag Manager or GA4 for more advanced data continuity across the transition.
Step 6: Update All Internal and External Links
This step is often overlooked but is crucial. Manually go through:
- Navigation menus
- Footer links
- Sidebar widgets
- Custom post types
- Forms or contact plugins
Additionally, update any links in your email marketing, social media bios, business directories, and third-party platforms. Tools like Ahrefs or Screaming Frog can help identify links pointing to the old domain that still need to be updated.
Leave a Reply