Knowledge Base

How to change the website URL in WordPress

This article describes how to change the URL for a WordPress site. You may need to do this, for example, to migrate an existing WordPress site to a new domain. Alternatively, you may want to test a WordPress installation using a temporary URL.

Changing the website URL in WordPress

 

To change the website URL in WordPress, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. In the Databases section of the cPanel home screen, click phpMyAdmin:

    cPanel - phpMyAdmin icon

  3. In the left-hand pane of phpMyAdmin, click the WordPress database. A list of tables in the database appears:

    phpMyAdmin - Select database

    Typically, the WordPress database is username_wpXXX or username_a2wpXXX, where username represents your cPanel username, and XXX is a three-digit number.
  4. Under the Table heading, click the wp_options table. A list of data rows appears:

    phpMyAdmin - WordPress options table

  5. Under the option_name heading, locate siteurl, and then click Edit:

    phpMyAdmin - Edit siteurl value

  6. In the option_value text box, replace the current URL with the new URL that you want to use.

    • Make sure you type the correct URL, or your WordPress installation will be inaccessible.
    • Make sure the URL begins with http://.
    • Make sure the URL does not end with a forward slash (/).
  7. Click Go. phpMyAdmin saves the changes in the table.
  8. Under the option_name heading, locate home, and then click Edit:

    phpMyAdmin - Edit home value

    You may have to scroll through more than one page of data in the wp_options table to locate the home row. To do this, click the > icon, or you can click Show all to view all of the table's rows at once.
  9. In the option_value text box, replace the current URL with the new URL that you want to use.

    • As above, make sure you type the correct URL, or your WordPress installation will be inaccessible.
    • Make sure the URL begins with http://.
    • Make sure the URL does not end with a forward slash (/).
  10. Click Go. phpMyAdmin saves the changes in the table. WordPress should now function correctly using the new URL.