Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to change the WordPress site URL

This guide shows you how to change the web address of your WordPress site, for example after moving to a new domain or switching to https.

WordPress2 min read16 steps6 screenshots

What is the site URL?

A URL is a web address, like https://example.com. WordPress keeps two addresses:

  • WordPress Address (URL): where your WordPress files are.
  • Site Address (URL): the address visitors type to reach your site.

Most of the time they are the same. Warning: if you type a wrong address, you can lock yourself out of your dashboard. Take a full backup of your files and database first. A database is the store where WordPress keeps your posts and settings.

Way 1: Use the dashboard

  1. Log in to your WordPress dashboard.
  2. Go to Settings, then General.
  3. Find WordPress Address (URL) and Site Address (URL).
  4. Type the new address in both boxes. Start with https:// if you have an SSL certificate. An SSL certificate encrypts the data between your visitors and your site.
  5. Click Save Changes.

You will be logged out. Log in again at the new address.

Way 2: Use wp-config.php

Use this if you cannot reach the dashboard. The file wp-config.php holds your main site settings.

  1. Open File Manager in your hosting control panel, or use FTP.
  2. Open the WordPress folder, often public_html.
  3. Right-click wp-config.php and choose Edit.
  4. Above the line that says "That's all, stop editing", add:
    define( 'WP_HOME', 'https://example.com' );
    define( 'WP_SITEURL', 'https://example.com' );
    Replace https://example.com with your real address. These lines override the saved address.
  5. Save the file.

Way 3: Use phpMyAdmin

phpMyAdmin is a tool that lets you edit the database in your browser.

  1. Open phpMyAdmin from your control panel.
    Screenshot: Open phpMyAdmin from your control panel.
  2. Click your WordPress database.
  3. Open the table ending in options, such as wp_options.
  4. Find the rows siteurl and home in the option_name column.
    Screenshot: Find the rows siteurl and home in the option_name column.
  5. Click Edit on each row and change option_value to the new address.
    Screenshot: Click Edit on each row and change option_value to the new address.
  6. Click Go.

After the change

Old links inside your posts may still use the old address. A search and replace plugin can fix them. Go to Plugins, then Add New, and search for one. Run it carefully, after a backup. Also, a new domain must point to your hosting through its DNS settings. DNS is the internet's phone book. Ask Hostvento support if you are unsure.

Tip: Remove the WP_HOME lines later if you want to manage the address from the dashboard again.

Quick recap

  • WordPress has a WordPress Address and a Site Address.
    Screenshot: WordPress has a WordPress Address and a Site Address.
    Screenshot: WordPress has a WordPress Address and a Site Address.
  • Change both in Settings then General.
  • If locked out, use wp-config.php or phpMyAdmin.
    Screenshot: If locked out, use wp-config.php or phpMyAdmin.
  • Back up first, then fix old links afterwards.