Free migrationUK web hosting from £2.99 a month, with backups every six hours and a 60-day money-back guarantee.UK web hosting from £2.99 a month.See hosting plans

How to change your WordPress site address

On this page

This guide shows how to change the address of a WordPress site, for example from http to https, or from an old domain to a new one, and how to update links that still use the old address.

Before you start

Change the address in Settings

  1. Log in to WordPress.
  2. Go to Settings, then General.
  3. Change WordPress Address (URL) and Site Address (URL) to the new address, for example https://yourdomain.co.uk. Don’t add a slash at the end.
  4. Click Save Changes. You’ll be logged out.
  5. Log in again at the new address.

If the two boxes are greyed out, the address is set in wp-config.php by lines starting define( 'WP_HOME' and define( 'WP_SITEURL'. Change them there in File Manager.

Update the old address in your content

Pages, menus and widgets still contain links and image addresses using the old address. You need to search for it and replace it across the database.

WordPress stores some settings as serialised data, which records the length of each piece of text. A plain find and replace in phpMyAdmin changes the text but not the length, which can break widgets and theme settings. Use one of the tools below, as they handle this properly.

With WP Toolkit

  1. Log in to cPanel and click WP Toolkit.
  2. Find your site and open its Database tab or section.
  3. Look for Search and Replace. The wording may differ between versions.
  4. Enter the old address, for example http://yourdomain.co.uk, and the new address.
  5. Run the replacement, then check your site.

With WP-CLI

On our WordPress plans you can use WP-CLI over SSH. Go to your WordPress folder and run a test first, which shows what would change without changing it:

wp search-replace 'http://yourdomain.co.uk' 'https://yourdomain.co.uk' --dry-run

If the numbers look right, run the same command again without the last part to make the changes. Then clear any cache.

If it doesn’t work

  • You can’t log in after saving. Edit wp-config.php and set WP_HOME and WP_SITEURL to the address that works, then log in and correct the settings.
  • The browser shows a padlock warning on https. Some images or scripts still load over http. Run the search and replace again, and check your theme settings.
  • The site keeps redirecting in a loop. Clear your browser cookies and any caching plugin, then check both address boxes match exactly.

Good to know

After moving to a new domain, set up a redirect from the old one so visitors and search engines find the new address. Ask us in a ticket if you’re unsure how.

Still stuck? Open a support ticket and we’ll help.

Still stuck? Open a support ticket from your client area. Tell us your domain and which step went wrong, and we'll take it from there.
WordPress hosting from £2.99 a month

WP Toolkit, staging, backups every six hours and free migration of your site.

See WordPress hosting
Open in new tab