WordPress
Change WordPress Site URL Safely
Correct a wrong or mismatched WordPress site URL without breaking the site.
The Problem
Your WordPress site URL is wrong — maybe after a botched migration, a restored backup from a different environment, or moving from a staging subdirectory — and attempts to fix it through wp-admin fail because you can't even log in or the setting itself is inaccessible.
About this problem
The site URL (siteurl) and home address (home) are two of the most foundational settings in WordPress, and when they're wrong, they can lock you out of the very admin screen you'd normally use to fix them, since wp-admin itself relies on those values being correct. This is why it often needs fixing directly via wp-config.php or the database, rather than through the normal settings page.
It commonly comes up after restoring a backup taken from a staging URL, a migration that didn't update these values, or manual server changes that left WordPress pointing at the wrong address.
What's Included
- Diagnosing whether the mismatch is in siteurl, home, or both
- Correcting the values directly via wp-config.php or the database, bypassing the need for admin access
- Checking for any related serialized data affected by the URL change
- Confirming both the front end and wp-admin load correctly afterwards
What's NOT Included
- A full domain change with redirects and SEO preservation (see 'Move WordPress Website to New Domain' for that larger scope)
- Fixing unrelated issues uncovered during the process (flagged separately if found)
- Restoring from backup itself, if that's also needed (separate recovery service)
How It Works
- Determine the correct intended URL and compare it against the current siteurl and home values.
- If wp-admin is inaccessible because of the mismatch, correct the values directly via wp-config.php or a direct database update.
- Check for any plugin-specific URL references that might also need correcting alongside the core settings.
- Clear any cache that might be serving the old, incorrect URL.
- Confirm both the public site and the wp-admin dashboard load correctly at the intended address.
In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.
Frequently Asked Questions
- What's the difference between WordPress's siteurl and home settings?
- siteurl is where WordPress's core files actually live, while home is the address visitors use to reach the site — they're usually the same, but can differ deliberately (e.g. WordPress installed in a subdirectory but displayed at the root).
- Can a wrong site URL lock me out of wp-admin?
- Yes, if the mismatch is severe enough, wp-admin can become inaccessible or redirect incorrectly, which is exactly why this sometimes needs fixing directly in the database rather than through the dashboard.
- Why does my restored WordPress backup show the staging site's URL?
- Backups capture whatever siteurl/home values were set at the time, so restoring a backup taken on a staging environment brings the staging URL with it unless those values are corrected afterwards.
- Is editing wp-config.php to fix the site URL risky?
- It's a standard, well-documented fix when done correctly, and a backup is taken first regardless, but it's easy to get wrong without knowing exactly which lines to add or change.
- Will fixing the site URL affect my site's content or design?
- No, this only affects what address WordPress thinks it's running on — your actual posts, pages and design are untouched.