A wrong URL can lock you out of WordPress, break images, and send visitors to the wrong address. That’s why you need to change WordPress site URL settings with a backup and a clear recovery plan in place.
The process is usually simple when you know which address to change, where WordPress stores it, and what needs updating afterward. We’ll walk through the safest options, including the dashboard, wp-config.php, phpMyAdmin, and WP-CLI.
What changes when you update a WordPress URL?
WordPress uses two related addresses:
- WordPress Address (URL) points to the folder where WordPress core files are installed.
- Site Address (URL) is the public address visitors use to open your website.
On most sites, both addresses are identical. They can differ when WordPress is installed in a subdirectory, such as example.com/wordpress, while the public site uses example.com.
You might need to change these addresses for several reasons:
- Moving from a temporary domain to your real domain.
- Switching from
http://tohttps://. - Changing from a non-www domain to a www domain, or the reverse.
- Moving WordPress from a subfolder to the main domain.
- Moving the site to a new hosting account.
- Correcting an old domain that still appears in WordPress settings.
The right method depends on whether you can access the WordPress dashboard. If the dashboard works, the Settings page is the quickest option. If you’re locked out, wp-config.php, phpMyAdmin, or WP-CLI can restore access.
| Change you’re making | What must be ready first |
|---|---|
| HTTP to HTTPS | A working SSL certificate |
| Temporary domain to live domain | DNS pointed to the correct hosting account |
| Old domain to new domain | A backup, search-replace plan, and redirects |
| Subfolder to root domain | Correct WordPress and site addresses |
| Move to new hosting | Files, database, DNS, and email access |
The WordPress migration handbook also recommends backing up your database before changing migration settings. That one step gives you a way back if the new address causes trouble.
Prepare your site before changing the address
A URL change can affect more than the homepage. WordPress content, image paths, theme settings, plugins, menus, forms, and third-party services may still contain the old address.
Start with a complete backup of your files and database. Store at least one copy away from the server. A backup inside the same hosting account won’t help much if the account has a serious failure.
Next, confirm that you can access the important parts of your hosting account:
- Your hosting control panel, such as cPanel.
- File Manager or FTP access.
- phpMyAdmin or another database tool.
- Your domain registrar and DNS settings.
- Your WordPress administrator account.
- Your SSL certificate settings.
Write down the current values of both URL fields before making changes. If you’re moving between domains, record the old domain exactly, including http, https, and whether it uses www. A small difference matters during search-replace work.
If you’re changing from HTTP to HTTPS, install and test the SSL certificate first. Opening https://yourdomain.com should show a secure connection before you update WordPress. If the certificate isn’t ready, WordPress may send visitors into a redirect loop or show certificate warnings.

We also recommend pausing automated cache, security, and optimization changes during the update. Caching can make an old URL appear even after the database is correct. Clear the cache after the new address is working.
Hosting support matters here. If backups, SSL, and database access are difficult to find, the migration becomes harder than it needs to be. ZADiC offers WordPress hosting, cPanel access, security monitoring, and 24/7 human support for site owners who want reliable infrastructure without handling every server task alone. Many plans also include free SSL, and you can review the available SSL certificate options before moving a site.
How to change WordPress site URL from the dashboard
Use the WordPress dashboard when the site loads normally and you can sign in.
Go to Settings > General. You’ll see:
- WordPress Address (URL)
- Site Address (URL)
Update both fields with the new full address. Include the protocol, such as https://, and leave off the final slash.
For example, if your site is moving to a secure domain, both fields might become:
https://example.com
Check the spelling before saving. A missing letter, extra space, or incorrect domain can immediately make the dashboard unavailable.
Click Save Changes. WordPress may log you out because the login address has changed. Open the new URL, sign in again, and visit a few pages.
This method works well for changes such as:
http://example.comtohttps://example.comexample.comtowww.example.com- A temporary hosting URL to your live domain
If you’re moving the entire site to a different domain, saving these fields is only the first step. Existing content may still contain the old URL, so you’ll need to update internal links, images, and redirects afterward.
If the dashboard refuses to load, don’t keep guessing at the settings. Use one of the recovery methods below.
Use wp-config.php when the dashboard is unavailable
The wp-config.php method is useful when an incorrect URL has created a login loop or made the admin area unreachable. It tells WordPress which addresses to use, even when the database still contains the old values.
Open your hosting File Manager or connect through FTP. Find wp-config.php in the main WordPress folder. Download a copy before editing it.
Add these two lines above the comment that says That's all, stop editing! Happy publishing.:
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
Replace https://example.com with your real address. Use the full protocol and don’t add a trailing slash.
The two constants have different jobs. WP_HOME controls the public site address. WP_SITEURL controls where WordPress is installed. For a standard installation, both values usually match.

Save the file and test the homepage. Then try /wp-admin at the new address. If the site loads, the constants have taken priority over the old database values.
There’s an important catch. These constants override the values in the database, which can make the URL fields in Settings > General appear locked or unavailable. That’s expected.
Once the site works and you’re ready to manage the address from the dashboard again, remove both lines from wp-config.php. Keep a copy of the original file until you’ve tested the entire site.
Don’t leave RELOCATE in wp-config.php as a permanent fix. WordPress documentation warns that this setting can create a security problem because an attacker may be able to influence the site URL in some configurations.
This method is a strong recovery tool, but it doesn’t update old links inside posts, pages, widgets, or plugin settings. You’ll still need to complete the cleanup after restoring access.
Edit the database directly with phpMyAdmin
When the dashboard and configuration file aren’t enough, edit the URL values in the WordPress database. This method is precise, but it deserves more care because a wrong database edit can affect the whole site.
Export the database before changing anything. In cPanel, open phpMyAdmin, select the WordPress database, and find the options table.
The table is often called wp_options, but don’t assume the wp_ prefix. Many WordPress installations use a custom prefix, such as wpabc_options. Look for the table ending in _options.
Find these two rows:
siteurlhome
Edit the option_value field for both rows. Replace the old address with the complete new address, such as https://example.com.
Do not change the option_name values. Do not add a trailing slash. Save each update and then test the site in a private browser window.

Changing only one row can leave WordPress in a half-working state. The homepage may load while the login page fails, or the dashboard may redirect to the old domain. Update home and siteurl together unless you have a specific reason for keeping them different.
A database search can also find the old URL in post content, widget settings, menus, and plugin data. Don’t run a blanket find-and-replace across every database column by hand. WordPress and plugins often store serialized data, and a basic SQL replacement can damage its structure.
You can update the two main URL rows in phpMyAdmin, then use WP-CLI for a safer full-site replacement. That gives you better control over serialized values and lets you preview the changes before applying them.
Avoid changing post GUID values as part of a normal domain move. They are identifiers, not ordinary visitor-facing links. Focus on content URLs, media paths, menu links, and plugin settings that still point to the old domain.
Use WP-CLI for a controlled full-site update
WP-CLI is a good choice when you have SSH access and want to check each step from the command line. Run commands from the WordPress installation folder.
First, confirm the current values:
wp option get siteurl
wp option get home
Update both options:
wp option update siteurl 'https://example.com'
wp option update home 'https://example.com'
For a full domain migration, preview a search-replace operation before applying it:
wp search-replace 'https://oldsite.com' 'https://example.com' --all-tables-with-prefix --skip-columns=guid --dry-run
The --dry-run option shows what would change without writing to the database. Review the results carefully. If the old and new domains are correct, run the same command without --dry-run.
This approach is safer than editing serialized plugin data manually. It also makes it easier to repeat the process on a staging copy before touching the live site.
If you don’t have SSH or WP-CLI access, use the dashboard, wp-config.php, or phpMyAdmin instead. Your hosting provider may also be able to run the migration for you.
Fix links, redirects, SSL, and caches after the change
Updating home and siteurl doesn’t automatically repair every reference to the old address. Work through the site in a logical order.
First, go to Settings > Permalinks and click Save Changes. You don’t need to alter the permalink structure. Saving the page refreshes WordPress rewrite rules and often fixes 404 errors after a move.
Then test:
- The homepage and several internal pages.
- WordPress login and logout.
- Images, downloads, and embedded videos.
- Main navigation and footer links.
- Contact forms and checkout pages.
- Search results and category pages.
- Mobile layouts.
- Any membership or account areas.
If you moved to a new domain, create permanent 301 redirects from the old URLs to the matching new URLs. Redirects help visitors and search engines find the new pages. Avoid sending every old page to the homepage when a matching destination exists.
For an HTTP-to-HTTPS change, check for mixed content. A page may load over HTTPS while images, scripts, or stylesheets still request HTTP files. Update those references, then test with a browser security panel or a trusted site scanner.
Clear every relevant cache:
- WordPress caching plugins.
- Server-level cache.
- CDN cache.
- Browser cache.
- Object cache, if your host uses one.
Check your canonical URLs and XML sitemap too. They should use the new address, not the old domain or protocol. If the site uses Google Search Console, add or verify the new property and submit the current sitemap.
The WordPress Codex discussion about changing the site URL also covers cases where the public address differs from the directory where WordPress is installed. That distinction matters when moving a subdirectory installation.
Common problems after a WordPress URL change
Most failures fall into a few familiar patterns. Knowing the symptom helps you choose the right fix instead of making more changes at random.
| Problem | Likely cause | First fix |
|---|---|---|
| Login keeps returning to the old domain | Old URL in the database or cache | Add temporary WP_HOME and WP_SITEURL values |
| Too many redirects | Conflicting HTTPS or www rules | Check SSL, proxy settings, and redirect rules |
| Homepage works but inner pages show 404 | Rewrite rules weren’t refreshed | Save the Permalinks settings |
| Images still use the old domain | Old URLs remain in post content or media settings | Run a careful search-replace |
| Secure page shows warnings | Mixed HTTP content or missing SSL | Update asset URLs and check the certificate |
| White screen after editing files | PHP syntax error or incompatible plugin | Restore the backup and review the last change |
A redirect loop often happens when your host or CDN handles HTTPS while WordPress also receives confusing protocol information. Check the hosting SSL settings before adding more redirect rules.
If you lose access after editing wp-config.php, restore the previous copy through File Manager or FTP. If the database edit caused the problem, import the backup or reverse the two changed values.
When a site is business-critical, support can save hours of trial and error. ZADiC provides 24/7 human support, security monitoring, and hosting options that can grow from standard WordPress hosting to managed Web Hosting Plus or VPS services. That gives you a practical place to turn when a URL change touches DNS, SSL, server files, and databases at the same time.
Final checks for SEO and visitors
A successful URL change should look boring to visitors. Pages load at the new address, old links redirect properly, forms work, and no browser shows a security warning.
Before you finish, check the following:
- The WordPress and Site Address fields show the intended URL.
- The old domain redirects to relevant new pages.
- Internal links and image URLs use the new address.
- Canonical tags and the sitemap use the new protocol and domain.
- Analytics, email forms, payment tools, and APIs use the correct address.
- Google Search Console has the new property or domain configuration.
- Cache layers have been cleared.
- The site works on mobile and in a private browser window.
Keep the old domain registered and active when you move to a new domain. A redirect is only useful while the old address still points somewhere.
Conclusion
You can change WordPress site URL settings safely when you back up first, update both address values, and test the site after each major step. The dashboard is easiest, while wp-config.php, phpMyAdmin, and WP-CLI give you reliable options when access breaks.
Treat the URL like part of your site’s foundation, not a small text field. With working SSL, clean redirects, updated links, and dependable hosting support, the move can be quick, controlled, and easy for visitors to follow.





