To change WordPress siteurl and home after moving to a new domain, open phpMyAdmin, go to the wp_options table, edit the siteurl and home rows, and set both option_value fields to your new address, including https. Save with Go and reload the site. You can also set them in Settings, General or wp-config.php.
What are siteurl and home in WordPress?
WordPress stores two web addresses in its database, and people often confuse them.
- siteurl is the WordPress Address: where the WordPress core files live.
- home is the Site Address: the public address visitors type.
On most sites they are identical, for example https://yoursite.com. When both are right, the site loads normally. When they point to an old domain, WordPress sends visitors there, so the design breaks or the browser shows a privacy error.
Why does a site break after moving to a new domain?
If you move your site to a new domain and the site breaks, shows a “Privacy Error”, or keeps pointing back to the old URL, the database needs a manual update.
This happens because the database copy still holds the old address, even though the files have moved. Fix the two stored values and the site follows.
Four ways to change the WordPress site URL
| Method | Use when |
|---|---|
| Settings, General | You can still log in to the dashboard |
| phpMyAdmin, wp_options | You are locked out or redirected away from the dashboard |
| wp-config.php constants | You need a quick override without opening the database |
| WP-CLI | You have command-line access and prefer one command |
Method 1: Settings, General
Log in, open Settings, then General, and edit WordPress Address (URL) and Site Address (URL). Both should start with https:// and have no slash at the end. Save and log in again if asked.
Method 2: change siteurl and home in phpMyAdmin
Use this when the dashboard will not load.
Open phpMyAdmin and then the wp_options table. Locate the first two rows, siteurl and home, and click Edit on each.
Change the option_value from the old URL to your new domain, for example from https://old-site.com to https://new-site.com. Click Go for both. This points WordPress to the correct address so the design and links load properly.
Remember to back up the database first, and check that your table prefix matches, because the table may be named differently from wp_options.
Method 3: set WP_HOME and WP_SITEURL in wp-config.php
Add two lines to wp-config.php above the line that says to stop editing, with your new address in each. WordPress documentation says these constants override the stored values but do not change the database itself, so the Settings screen will show the values as fixed. Use this as a temporary rescue and then update the database properly.
Method 4: use WP-CLI
If your host provides WP-CLI, you can update both options with the wp option update command for home and for siteurl. It is quick and avoids manual editing.
A worked example of the values (illustrative)
Suppose your old site was at https://old-site.com and you moved it to https://new-site.com. In wp_options, the siteurl row changes from https://old-site.com to https://new-site.com, and the home row changes the same way. If you had WordPress installed in a subfolder called blog, siteurl might be https://new-site.com/blog while home stays https://new-site.com. That is the one common case where the two differ.
Do not change the GUID column
When you search the database for the old URL, you may notice a column called guid in the posts table. WordPress documentation is clear that you should never change the contents of the GUID column, because feed readers use it to recognise posts as unique.
Fix old links inside your content
Changing the two options does not rewrite links stored inside posts and pages. Images or links that still point to the old domain can break or cause mixed content warnings. Use a trusted search-and-replace tool that understands serialized data, take a backup first, and run a dry run before applying changes.
After the move: redirects, SSL and Search Console
- SSL: install a certificate on the new domain before you switch the address, or visitors will see a warning.
- Redirects: set permanent redirects from the old domain to the matching pages on the new one, so people and search engines follow the move.
- Search Console: add the new site as a property and use Google’s change-of-address tool if the old site was verified there.
- Sitemap: submit the new sitemap and update internal links.
A migration checklist
Back up files and database, copy to the new host, update wp-config.php credentials, change siteurl and home, test the site on the new address, fix content links, install SSL, set redirects and then check Search Console.