Changing a WordPress site URL can be necessary when you move from HTTP to HTTPS, change domains, move WordPress into a different directory, or need to correct an incorrect URL setting. It is also one of those changes where a small mistake can make the front end or WordPress dashboard difficult to access.
The safest approach is to understand the two URL settings first, make a backup before changing anything, and choose the least invasive method for your situation.
WordPress Address vs. Site Address
WordPress uses two related URL settings:
- WordPress Address (URL): the location where the WordPress core files are installed.
- Site Address (URL): the address visitors use to reach your website.
On many sites, these values are identical. They can be different when WordPress is installed in a subdirectory but the public site uses another location.
WordPress documents both settings in its General Settings screen and warns that values defined with WP_SITEURL or WP_HOME in wp-config.php cannot be edited from the normal settings screen. See the official WordPress documentation.
When You Might Need to Change the URL
Common situations include:
- Moving from
http://tohttps://. - Changing from one domain to another.
- Moving WordPress from a subdirectory to the root of a domain.
- Correcting an accidentally changed URL.
- Moving a site to a new hosting environment.
A domain migration is more than changing two settings. Existing internal links, image URLs, redirects, canonical URLs, and other stored references may also need attention.
Before Changing Anything, Make a Backup
Do not treat a URL change as a routine setting adjustment. Make a current backup of your database and WordPress files first, especially when changing domains or editing configuration files.
If something goes wrong, having a known-good backup gives you a recovery path instead of trying to repair the site while it is already inaccessible.
Method 1: Change the URL in WordPress Settings
If you can still access the WordPress dashboard and the URL fields are editable, this is normally the simplest method.
- Open Settings → General.
- Review WordPress Address (URL).
- Review Site Address (URL).
- Enter the correct full URLs, including
https://when HTTPS is enabled. - Save the changes.
Do not add a trailing slash to these values. WordPress’s documentation explains that these settings control the location of the WordPress installation and the address visitors use to reach the site.
What If the URL Fields Are Locked?
If the URL fields cannot be edited, check whether the site defines WP_HOME or WP_SITEURL in wp-config.php. Those constants can override the values normally managed from the dashboard.
For example, a configuration may contain:
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
Do not copy these lines blindly. They are an example of how URL values can be hard-coded. If your site already uses these constants, update them carefully and keep a backup before editing the configuration file.
If You Accidentally Broke the Site URL
If an incorrect URL prevents the front end or dashboard from working, WordPress provides several recovery approaches, including correcting the stored home and siteurl values through the database or temporarily defining the URL values in wp-config.php.
These methods are more technical, so use them only when necessary. WordPress’s developer documentation specifically covers changing the URL manually and moving a site between locations.
Changing a Domain Requires More Than Two URL Fields
If you are moving from old-domain.com to new-domain.com, changing the WordPress Address and Site Address is only one part of the migration.
After the change, check:
- Internal links.
- Images and media URLs.
- Navigation menus.
- Customizer or Site Editor settings.
- Plugin and theme configuration.
- Canonical URLs and XML sitemaps.
- Redirects from important old URLs.
- Search engine and analytics configuration.
- Forms and other integrations that use the old domain.
Be especially careful with database-wide search-and-replace operations. Some WordPress data uses serialized values, so replacing strings with a generic database tool can damage stored data if the tool does not understand WordPress serialization.
Test the Site After the Change
Do not stop after the homepage loads. Test the parts of the site visitors and administrators actually use.
- Open the homepage and several important posts and pages.
- Log in to the WordPress dashboard.
- Test navigation links.
- Open images and media.
- Submit important forms.
- Check that HTTPS is working correctly.
- Look for mixed-content warnings.
- Check redirects when changing domains.
- Review WordPress Site Health for new problems.
WordPress Site Health includes information about the Home URL, Site URL, permalink structure, HTTPS status, WordPress version, plugins, themes, server configuration, and other parts of the installation.
Common Mistakes to Avoid
- Changing only one URL when both need to change. Understand why the two values are different before editing them.
- Forgetting HTTPS. If the site has moved to HTTPS, make sure the intended URL uses the correct protocol.
- Editing the database without a backup. Database changes can have site-wide consequences.
- Changing URLs without redirects. A domain migration should preserve important old URLs where possible.
- Assuming the homepage is enough to test. Forms, images, login, media, and internal links can fail even when the homepage appears normal.
When You Should Get Help
Consider getting experienced WordPress or hosting assistance if you are moving a production site to a new domain, cannot access the dashboard after changing the URL, need to perform a large database search and replace, or are unsure whether a configuration value is being overridden by wp-config.php.
Final Checklist
- Back up the database and files.
- Confirm whether you need to change WordPress Address, Site Address, or both.
- Use Settings → General when the fields are available and appropriate.
- Check
WP_HOMEandWP_SITEURLif the fields are locked. - For domain changes, update related URLs and configure appropriate redirects.
- Test the front end, dashboard, links, media, forms, and HTTPS.
- Review Site Health after the change.
Changing a WordPress site URL is manageable when you treat it as a configuration and migration task rather than simply replacing a text value. Take a backup first, make the smallest necessary change, and test the complete site afterward.

Leave a Reply to This Post