Whether you’re moving to a new domain, switching from HTTP to HTTPS or dropping the www, changing your WordPress site URL needs care. Get it wrong and you can lock yourself out of the dashboard. Here are the safe ways to do it, depending on your situation.

Method 1: the Settings page (if you can log in)

The straightforward way, when you still have dashboard access:

  1. Go to Settings → General.
  2. Update WordPress Address (URL) and Site Address (URL).
  3. Save.

Only use this when the URL is simply changing scheme (http to https) or www preference on the same domain. If you’re moving to a genuinely new domain, this alone isn’t enough — see below.

Method 2: wp-config.php (if you’re locked out)

If a wrong URL has already locked you out, override the settings in wp-config.php:

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

These take priority over the database values and grey out the Settings fields, so they’re a safe, reversible way to force the correct URL.

Method 3: full domain change (search and replace)

Moving to a brand-new domain means every reference to the old URL — in post content, widgets and settings — must be updated. Changing only the two settings fields leaves broken links and images everywhere. Use a “better search replace” plugin to swap the old domain for the new one throughout the database. Always back up the database first, and do a dry run before committing.

After the change

Re-save your permalinks (Settings → Permalinks → Save) to refresh rewrite rules. Clear any caching plugin and your browser cache. Then click through the site checking that images load and internal links point to the new URL.

Set up redirects

If the old domain will still receive traffic, add 301 redirects from old to new so visitors and search engines follow along and you preserve your SEO.

Domain changes have a lot of moving parts. If you’d rather not risk it, we can move and rewrite everything for you cleanly — just ask.

Was this article helpful to you?

admin

Leave a Reply

You must be logged in to post a comment.