WordPress

How to Change Your WordPress Site URL

There are several reasons to change your WordPress site URL — moving to a new domain, switching from http to https, or dropping the www. WordPress stores this address in a couple of places, so it helps to know the safe way to change it. Take a backup first.

Method 1: From WordPress settings (easiest)

If you can still log in to WordPress:

  1. Go to Settings → General.
  2. Update the WordPress Address (URL) and Site Address (URL) to the new address.
  3. Save. WordPress uses the new URL immediately.

Use this only when the new address already works — setting a wrong URL here can log you out.

Method 2: In wp-config.php

To force the URLs (handy when you cannot log in), edit wp-config.php with the File Manager and add:

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

Method 3: In the database

Advanced users can update the siteurl and home values in the wp_options table via phpMyAdmin. Careful — edit only those two rows.

Don’t forget the rest

After changing the URL, update internal links and images that used the old address. If you moved to HTTPS, fix any mixed content warnings. Just testing on a temporary address? See using a temporary URL.

Frequently asked questions

I changed the URL and now I am locked out.

Set the correct URL using the wp-config.php method above, which overrides the settings and restores access.

Will changing my URL affect SEO?

Moving domains can, so set up 301 redirects from the old address to the new one to preserve your rankings.

My images broke after the change.

They still reference the old URL. A search-and-replace (via a plugin or database) updates them to the new address.

Was this article helpful?