How to Change a WordPress URL Safely
Changing a WordPress domain or website URL incorrectly can break images, layouts, page builders, or even the entire website. This guide explains the safest ways to update WordPress URLs and avoid serialised data problems.
Common Causes of Problems
Basic Search & Replace
Direct database replacements can corrupt serialised WordPress data.
Page Builder Data
Elementor, Beaver Builder, and widgets may still contain old URLs.
Mixed Content
Old HTTP links can trigger SSL and browser security warnings.
Step-by-Step Fixes
Update WordPress Settings
Go to:
Settings → General
Update both:
WordPress Address (URL) Site Address (URL)
Use Better Search Replace
Use a plugin designed to safely update WordPress URLs while handling serialised data correctly.
Recommended:
- Better Search Replace
- WP Migrate DB
Avoid Raw SQL Replacements
Manual SQL search and replace queries can break serialised data and corrupt page builder layouts.
Clear Cache
Clear WordPress cache, server cache, CDN cache, and browser cache after changing URLs.
Regenerate Page Builder Data
Some page builders may require CSS regeneration or cache rebuilding after a domain change.
Examples:
- Elementor → Regenerate CSS
- Beaver Builder → Clear Cache
Check SSL & Redirects
Ensure the new domain has a valid SSL certificate and correct 301 redirects configured.
Why Serialised Data Matters
What is Serialised Data?
WordPress stores some plugin and theme settings in a special serialised format.
Why Sites Break
Serialised data includes character counts. Incorrect replacements can corrupt the stored data structure.
Common Symptoms
- Broken layouts
- Missing images
- White screens
- Broken widgets
- Page builder errors
Recommended Plugins & Tools
WP Migrate DB
Excellent for full migrations and safe URL replacements.
Better Search Replace
Popular plugin for safe database search and replace operations.
WP-CLI
Advanced command-line option for developers.
wp search-replace oldsite.com newsite.com
Quick Tips
Backup First
Always create a full backup before changing website URLs or domains.
Use Staging
Test URL changes on a staging site before updating the live website.
Flush Permalinks
Go to Settings → Permalinks and click Save Changes after migration.