Get a free website with any plan

See how
WORDPRESS

Changing your WordPress site's domain

Moving your WordPress site to a different domain — rebrand, consolidating from multiple domains, switching from .dev to .com after launch — requires updating the site's URL settings and search-replacing old URLs in the database.

The pieces involved

Three places store the site's URL:

  1. WordPress options tablesiteurl and home settings (visible in wp-admin → Settings → General).
  2. Content — your posts, pages, custom fields. Old URLs in image references, links, etc.
  3. Database tables — some plugins store URLs in serialized data (e.g., widget settings, theme options).

All three need updating.

Easiest: Search-Replace plugin

For most sites:

  1. Install Better Search Replace plugin (free).
  2. Go to Tools → Better Search Replace.
  3. Configure:
    • Search for: old URL (e.g., https://olddomain.com).
    • Replace with: new URL (e.g., https://newdomain.com).
    • Select tables: all of them (or at least wp_options, wp_posts, wp_postmeta, wp_options).
    • Run as dry run first — see what would change without committing.
  4. Run the dry run, review, then run for real.

The plugin handles serialized data correctly — replacing strings inside serialized arrays without breaking them. This is the key thing distinguishing it from raw SQL search-replace.

Update siteurl and home

After the search-replace runs, also update these explicitly:

wp-admin → Settings → General:

  • WordPress Address (URL): https://newdomain.com
  • Site Address (URL): https://newdomain.com

These should match what the search-replace updated. If you ran a comprehensive search-replace, they're likely already correct.

Manual: wp-cli

For developer-friendly sites with shell access:

cd /home/your-user/public_html

# Update siteurl and home
wp option update home 'https://newdomain.com'
wp option update siteurl 'https://newdomain.com'

# Search-replace across all content (handles serialized data)
wp search-replace 'olddomain.com' 'newdomain.com'

# Flush rewrite rules
wp rewrite flush

The wp search-replace command is wp-cli's built-in equivalent of the Better Search Replace plugin. It's faster and safer than manual SQL.

When you can't access wp-admin

If your site won't load after the change (because the URL settings don't match where you actually visit it from), update via:

Option 1: wp-config.php override

Add to wp-config.php:

define('WP_HOME', 'https://newdomain.com');
define('WP_SITEURL', 'https://newdomain.com');

These hard-code the URL settings, overriding what's in the database. WordPress loads correctly at the new URL.

Option 2: Database update via phpMyAdmin

  1. Open phpMyAdmin from your hosting.
  2. Navigate to your WordPress database → wp_options table.
  3. Find rows where option_name is home and siteurl. Edit option_value to your new domain.
  4. Save.

WordPress's URL settings now match the actual URL.

DNS cutover

Don't forget DNS:

  1. Point newdomain.com at your hosting's IP (or use our nameservers). See Pointing your domain to your hosting.
  2. Wait for DNS propagation.
  3. Test the site loads at the new domain.

If you're keeping the old domain working too, set up a 301 redirect from olddomain.comnewdomain.com. See Redirecting URLs.

Common issues after domain change

Mixed content warnings

Browser shows "not secure" or "mixed content" because some asset URLs are still pointing at the old domain. Run a more thorough search-replace; check wp-content/themes/your-theme/ for hardcoded URLs.

Broken images

Image URLs in posts are still pointing at the old domain. Search-replace should fix; if not, check the database wp_posts table directly.

Cached pages still show old URL

Flush all caches:

  • wp-admin → LiteSpeed Cache → Toolbox → Empty Entire Cache.
  • Cloudflare → Caching → Purge Everything.
  • Browser hard-refresh.

Theme/plugin custom settings broken

Some themes and plugins store URLs in their own settings structures (often serialized). If they use absolute URLs and don't get caught by search-replace:

  • Look in wp_options for plugin-specific rows referencing the old URL.
  • Update them via phpMyAdmin or the plugin's own settings page.

Power-user note

For sites with serialized data in custom database tables (not just wp_options or wp_postmeta), the safer search-replace tool is WP Migrate Lite or its paid version WP Migrate. They handle a wider range of serialized data types than Better Search Replace.

For migrations between development/staging/production environments, set up a wp-cli workflow:

wp search-replace 'staging.yourdomain.com' 'yourdomain.com' --all-tables --dry-run

The --all-tables flag covers custom plugin tables. --dry-run previews without committing.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.