Knowledge Base

How to configure WordPress to use a temporary URL

This article describes how to configure WordPress to use a temporary URL. You may want to do this, for example, to test a WordPress installation on a new domain before you update the domain's DNS records.

Configuring WordPress to use a temporary URL

When you move your WordPress site to a new domain, or install a brand-new WordPress site, you probably want to test it before you update the domain name's DNS and take the site “live”. To do this, you can use the shared URL for your account.

For information about how to obtain the correct shared URL for your hosting account, please see this article.

However, some parts of the WordPress site may not display correctly (or at all) using a shared URL. To fix this, you can manually update the WordPress database to use the shared URL temporarily. To do this, 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 shared URL that you want to use for testing.

    • Make sure you type the correct shared 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 shared URL that you want to use for testing.

    • As above, make sure you type the correct shared 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 shared URL.

Restoring the original WordPress URL

When you are done using the shared URL as a temporary URL for the WordPress installation, you must update the WordPress and site URLs with the site's actual domain name. However, instead of manually changing these values in phpMyAdmin, you can do this from the WordPress administration interface. To do this, follow these steps:

  1. Log in to WordPress as the administrator.
  2. Under Dashboard, click Settings, and then click General.
  3. Under General Settings, in the WordPress Address (URL) text box, type the URL using the site's domain name:

    WordPress - General Settings - WordPress URL

  4. In the Site Address (URL) text box, type the URL using the site's domain name:

    KB - General Settings - Site URL

  5. Click Save Changes. WordPress should now function correctly using the site's domain name (assuming you have updated DNS for the domain and allowed sufficient time for DNS propagation to complete).