Yes, you can change your WordPress domain, and it’s a common practice for businesses rebranding, upgrading hosting, or switching from temporary to permanent domains. The process involves updating database entries, file paths, and configuration settings to point to your new domain, then redirecting the old domain so visitors and search engines follow. When done correctly with proper preparation and the right methods, you can migrate your WordPress site without losing any data or functionality.
Understanding WordPress domain changes and migration essentials
Changing a WordPress domain means transferring your entire website from one web address to another whilst maintaining all your content, settings, and functionality. This process is more complex than simply pointing your domain to a new server because WordPress stores your domain name in multiple database locations. This guide covers self-hosted WordPress. On WordPress.com, domains are managed from the Domains settings in your account.
The technical aspects involve updating your WordPress database, which contains hardcoded references to your old domain in posts, pages, media files, and configuration settings. Your custom WordPress website relies on these internal links to function properly, so every reference must be updated systematically.
Businesses commonly need domain changes for several reasons. You might be moving from a development domain to your live site, rebranding your company, or switching to a more memorable domain name. Sometimes technical requirements like SSL certificates or hosting changes necessitate domain migrations. If you only want to duplicate a site, read how to copy a WordPress site to another domain. For the basics of using your own domain, see whether WordPress allows custom domains.
Can you change a WordPress domain without losing data?
Absolutely, you can change your WordPress domain without losing any data when the migration is executed properly. WordPress domain changes are fundamentally safe processes that preserve all your content, user accounts, comments, and media files.
During domain migration, several data elements require updating. Your WordPress database contains URL references in the wp_options table (the siteurl and home values), post content, widget settings, and customiser options. Media file paths stored in the database also need updating to reflect the new domain structure.
The key to data preservation lies in using systematic approaches that update all database references simultaneously. WordPress stores absolute URLs rather than relative ones, which means every internal link, image source, and configuration setting contains your full domain name. Some of this data is stored in serialised form, so a plain text replacement can corrupt it. Use tools that handle serialised data. Professional WordPress custom development services understand these intricacies and can ensure nothing gets overlooked during the migration process.
What are the main methods to change a WordPress domain?
There are four primary methods for changing WordPress domains, each with distinct advantages depending on your technical comfort level and site complexity.
Manual database updates involve directly editing your WordPress database using tools like phpMyAdmin. You’ll need to update the siteurl and home values in the wp_options table. Avoid blanket SQL REPLACE queries for the remaining URLs, because they corrupt serialised data. This method offers complete control but requires technical expertise.
WordPress plugins provide user-friendly alternatives for domain changes. Popular options include Better Search Replace and All-in-One WP Migration. These plugins automate the URL replacement process, and Better Search Replace offers a dry run to verify changes before you apply them. Choose actively maintained plugins. Velvet Blues Update URLs, which many older guides still recommend, was closed on WordPress.org in May 2024 for a security issue.
Many hosting control panels include migration tools that simplify domain changes. These integrated solutions often handle both file transfers and database updates, making them ideal for users who prefer guided processes.
WordPress CLI (Command Line Interface) offers powerful scripting capabilities for developers. The wp search-replace command can efficiently update URLs across your entire database, handles serialised data, and provides detailed feedback about the changes made. Run it first as a dry run, and skip the guid column, because GUIDs are meant to stay unchanged:
wp search-replace 'https://old-domain.com' 'https://new-domain.com' --skip-columns=guid --dry-run
When the dry run output looks right, run the same command without --dry-run. The WP-CLI documentation lists all options.
How do you prepare your WordPress site before changing domains?
Proper preparation is crucial for successful WordPress domain migration and prevents potential data loss or functionality issues.
Creating comprehensive backups should be your absolute priority. Download complete copies of your WordPress files via FTP and export your database through phpMyAdmin or your hosting control panel. Store these backups in multiple locations to ensure you can restore your site if anything goes wrong.
Document your current site settings, including active plugins, theme customisations, and any custom code modifications. Take screenshots of your customiser settings, widget configurations, and menu structures. This documentation becomes invaluable if you need to recreate specific configurations.
Check for hardcoded URLs in your theme files, custom plugins, and content. Search through your database for absolute URLs that might not be caught by standard replacement tools. Pay particular attention to custom functionality that might reference your old domain.
Prepare your new domain environment by setting up hosting, configuring DNS settings, and installing SSL certificates. Ensure your new hosting environment matches your current PHP version and server specifications to avoid compatibility issues. Export a list of your current URLs now, because you will need it for the redirect map.
What common problems occur during WordPress domain changes?
Several predictable issues can arise during WordPress domain migration, but understanding these problems helps you prevent or quickly resolve them.
Broken internal links frequently occur when URL replacement tools miss certain database entries. Page builders such as Elementor keep URLs in their own data and have separate replace tools. Mixed content warnings appear when some elements still reference your old domain, particularly in customised themes or plugins. Systematically checking all pages after migration helps identify these issues.
Missing images often result from incomplete media URL updates or file path changes. Your WordPress media library might display correctly in the admin area whilst showing broken images on the frontend. This typically indicates partial database updates that require additional attention.
SSL certificate problems can disrupt site functionality if your new domain’s security certificates aren’t properly configured. Ensure your SSL certificates are active and correctly installed before beginning the migration process.
Email functionality disruption commonly affects contact forms, user notifications, and automated emails. WordPress uses your domain for email headers and reply addresses, so these settings require manual updates after domain changes. Set up SPF, DKIM, and DMARC records for the new domain, or messages may land in spam.
Plugin and theme compatibility issues may surface if custom code contains hardcoded domain references. WordPress custom development often includes domain-specific configurations that need individual attention during migration.
How do you protect SEO when you change a WordPress domain?
A domain change moves your search visibility along with your content, so the redirects matter as much as the database update. Rankings usually recover once Google processes the move, but it can take several weeks.
- Redirect every old URL. Set up permanent 301 redirects from each old URL to its equivalent on the new domain, one to one, not everything to the homepage. A server-level rule is the most reliable option when the paths stay the same.
- Tell Google. Verify the new domain in Google Search Console, use the Change of Address tool in the old property, and submit the new XML sitemap. Google describes the process in its guide to site moves with URL changes.
- Update the signals. Check canonical tags, sitemap, robots.txt, hreflang, structured data, and internal links so they all point to the new domain. Ask your most important referring sites to update their links.
- Make sure the new site is indexable. Remove any “discourage search engines” setting or noindex tag left over from a development environment.
- Keep the old domain. Keep it registered and redirecting for at least a year, and longer if it still earns links or traffic.
Our WordPress migration work preserves content, URL structure, and SEO, which is the part of a domain change that teams most often underestimate.
Key takeaways for successful WordPress domain migration
Successful WordPress domain migration relies on methodical preparation, systematic execution, and thorough post-migration testing.
Always create complete backups before starting your migration, and verify these backups are functional. Choose migration methods that match your technical expertise, and don’t hesitate to use multiple approaches if your site has complex customisations.
Critical steps include updating your wp-config.php file, clearing all caching systems, and updating your DNS settings only after confirming everything works correctly on the new environment, for example on a staging copy or through a hosts-file override. Test all functionality including contact forms, user registration, and e-commerce features if applicable.
Post-migration testing should cover every aspect of your site. Check internal links, verify image loading, test plugin functionality, and confirm that search engines can properly crawl your new domain. Monitor your site closely for the first few days after migration to catch any issues quickly.
For complex sites with extensive customisations, multiple integrations, or critical business functions, professional assistance ensures smooth transitions. Expert developers can identify potential issues before they become problems and implement solutions that preserve all your site’s functionality whilst optimising performance for your new domain. A technical audit before the move shows where the old domain is hardcoded.
Frequently asked questions about changing a WordPress domain
Can you change a WordPress domain name?
Yes. You can move a WordPress site to a new domain without losing content, users, comments or media. The work consists of updating the site address, replacing old URLs in the database, and redirecting the old domain to the new one.
Can I change my WordPress domain from the dashboard?
Only partly. Settings > General lets you change the WordPress Address and Site Address, but it does not update links stored in your content. If the new domain does not point to the site yet, the change can also lock you out of the admin.
How do I change the domain in the WordPress database?
Update the siteurl and home values in the wp_options table, then replace the remaining old URLs with a tool that handles serialised data, such as WP-CLI search-replace or Better Search Replace. Avoid plain SQL REPLACE queries.
Will changing my WordPress domain hurt SEO?
Not if it is done properly. Set up one-to-one 301 redirects from every old URL, use the Change of Address tool in Google Search Console, and submit a new sitemap. Rankings can fluctuate for a few weeks while Google processes the move.
How long does a WordPress domain change take?
The technical steps usually take a few hours for a small site. DNS changes can take from minutes to about 48 hours to reach all visitors. SEO signals can need several weeks to settle.
Should I keep the old domain after the change?
Yes. Keep it registered and redirecting for at least a year, and longer if it still has backlinks or traffic. Letting it expire can send visitors and link value to whoever registers it next.



