{"id":3977,"date":"2026-08-01T13:22:03","date_gmt":"2026-08-01T13:22:03","guid":{"rendered":"https:\/\/veerhost.com\/docs\/wordpress-3\/how-to-update-site-urls-after-migrating-wordpress\/"},"modified":"2026-08-01T13:23:32","modified_gmt":"2026-08-01T13:23:32","slug":"how-to-update-site-urls-after-migrating-wordpress","status":"publish","type":"docs","link":"https:\/\/veerhost.com\/de\/docs\/wordpress-3\/how-to-update-site-urls-after-migrating-wordpress\/","title":{"rendered":"How to Update Site URLs After Migrating WordPress"},"content":{"rendered":"<p class=\"wp-block-paragraph\">After migrating a WordPress website to a new domain, subdomain, or hosting provider, you may need to update your site&#8217;s URLs. If the old URLs remain in your configuration or database, visitors may encounter broken images, redirect loops, login problems, or links that still point to the previous domain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to safely update your WordPress site URLs after a migration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When Should You Update Site URLs?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Updating site URLs is necessary when:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Moving to a new domain name<\/li>\n\n\n\n<li>Migrating from HTTP to HTTPS<\/li>\n\n\n\n<li>Moving from a subdomain to the main domain<\/li>\n\n\n\n<li>Migrating from a local development environment<\/li>\n\n\n\n<li>Cloning a WordPress website<\/li>\n\n\n\n<li>Restoring a backup on a different domain<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Before You Begin<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before making changes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a complete website backup.<\/li>\n\n\n\n<li>Verify that the migration has finished successfully.<\/li>\n\n\n\n<li>Confirm the new domain points to your hosting account.<\/li>\n\n\n\n<li>Ensure your SSL certificate is active if using HTTPS.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Update the WordPress Address<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you can access the WordPress dashboard:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to WordPress.<\/li>\n\n\n\n<li>Go to <strong>Settings \u2192 General<\/strong>.<\/li>\n\n\n\n<li>Update the following fields:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>WordPress Address (URL)<\/strong><\/li>\n\n\n\n<li><strong>Site Address (URL)<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Old URL<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;old-domain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>New URL<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;new-domain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Click <strong>Save Changes<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Update the URLs in the Database<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Changing the WordPress Address updates the site&#8217;s configuration, but existing content may still reference the old domain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These may include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Posts<\/li>\n\n\n\n<li>Pages<\/li>\n\n\n\n<li>Images<\/li>\n\n\n\n<li>Internal links<\/li>\n\n\n\n<li>Buttons<\/li>\n\n\n\n<li>Widgets<\/li>\n\n\n\n<li>Theme settings<\/li>\n\n\n\n<li>Plugin settings<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Update these references using a search-and-replace tool that supports WordPress serialized data.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Do not perform a simple SQL text replacement, as it can corrupt serialized data stored in the database.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Update the Home URL in wp-config.php (Optional)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you cannot access the WordPress dashboard, you can define the site URLs in the <code>wp-config.php<\/code> file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_HOME', 'https:\/\/new-domain.com');\ndefine('WP_SITEURL', 'https:\/\/new-domain.com');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and reload your website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Regenerate Permalinks<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After changing the site URL:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>Settings \u2192 Permalinks<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Save Changes<\/strong> without modifying any settings.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">This rebuilds WordPress rewrite rules and helps resolve 404 errors after migration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Clear Website Cache<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If caching is enabled, clear:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WordPress cache<\/li>\n\n\n\n<li>Server cache<\/li>\n\n\n\n<li>Object cache<\/li>\n\n\n\n<li>CDN cache<\/li>\n\n\n\n<li>Browser cache<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Cached pages may continue serving the old URLs until the cache is refreshed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Verify HTTPS Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your migration also included enabling SSL:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Confirm the website loads over HTTPS.<\/li>\n\n\n\n<li>Verify all internal resources use HTTPS.<\/li>\n\n\n\n<li>Check for mixed content warnings.<\/li>\n\n\n\n<li>Ensure HTTP requests redirect to HTTPS.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7: Test Your Website<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After updating the URLs:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The homepage loads correctly.<\/li>\n\n\n\n<li>The WordPress admin dashboard is accessible.<\/li>\n\n\n\n<li>Internal links work.<\/li>\n\n\n\n<li>Images display properly.<\/li>\n\n\n\n<li>Forms submit successfully.<\/li>\n\n\n\n<li>Plugins function normally.<\/li>\n\n\n\n<li>Media files load without errors.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common Issues After Updating URLs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Broken Images<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Images may still reference the previous domain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update image URLs in the database using a WordPress-compatible search-and-replace tool.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Redirect Loops<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Redirect loops can occur when:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WordPress URL settings conflict with server redirects.<\/li>\n\n\n\n<li>CDN SSL settings are incorrect.<\/li>\n\n\n\n<li>HTTP and HTTPS redirects overlap.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Review your server and CDN configuration to ensure redirects are applied consistently.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">404 Errors<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If pages return <strong>404 Not Found<\/strong> after migration:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Regenerate permalinks.<\/li>\n\n\n\n<li>Verify rewrite rules are active.<\/li>\n\n\n\n<li>Confirm the migration completed successfully.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Login Redirect Issues<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the login page continually redirects:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verify the <strong>WordPress Address<\/strong> and <strong>Site Address<\/strong> values.<\/li>\n\n\n\n<li>Clear cookies and browser cache.<\/li>\n\n\n\n<li>Check for conflicting redirect rules.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Verify the Migration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After completing the update:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Visit several pages across the website.<\/li>\n\n\n\n<li>Test the login page.<\/li>\n\n\n\n<li>Confirm media files display correctly.<\/li>\n\n\n\n<li>Review contact forms.<\/li>\n\n\n\n<li>Check WooCommerce functionality (if applicable).<\/li>\n\n\n\n<li>Search for any remaining references to the old domain.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a backup before updating URLs.<\/li>\n\n\n\n<li>Use HTTPS whenever possible.<\/li>\n\n\n\n<li>Update all internal links.<\/li>\n\n\n\n<li>Use a WordPress-aware search-and-replace tool for database updates.<\/li>\n\n\n\n<li>Clear all caches after migration.<\/li>\n\n\n\n<li>Test your website thoroughly before making it publicly available.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Why are my images still loading from the old domain?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Image URLs are typically stored in the WordPress database. Updating the site address alone does not automatically replace existing content URLs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need to update both WordPress Address and Site Address?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. In most cases, both settings should use the same domain unless you intentionally separate your WordPress installation from the public website.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why shouldn&#8217;t I use a simple SQL replace?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress stores some data in serialized format. A standard SQL replacement can corrupt this data, causing plugins or themes to malfunction.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Should I clear my cache after changing the site URL?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Clearing all caches ensures visitors receive the updated URLs instead of cached versions of the previous site.<\/p>","protected":false},"excerpt":{"rendered":"<p>After migrating a WordPress website to a new domain, subdomain, or hosting provider, you may need to update your site&#8217;s URLs. If [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3952,"menu_order":9,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-3977","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/3977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/comments?post=3977"}],"version-history":[{"count":1,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/3977\/revisions"}],"predecessor-version":[{"id":3979,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/3977\/revisions\/3979"}],"up":[{"embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/docs\/3952"}],"wp:attachment":[{"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/media?parent=3977"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/veerhost.com\/de\/wp-json\/wp\/v2\/doc_tag?post=3977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}