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

Use a temporary URL for your WordPress site

This guide shows how to view and run your WordPress site before your real domain points to your hosting.

WordPress2 min read12 steps6 screenshots

What is a temporary URL?

A temporary URL is a short-term web address that opens your site straight from the server. You can use it while your domain still points somewhere else. This is handy when you move a site and want to test it first. Think of it as a back door you use before the front door is ready.

Your welcome email or your hosting control panel shows the temporary address format for your plan. If you cannot find it, ask Hostvento support.

Warning: Take a backup before you start. Changing site addresses can make a site unreachable if you make a mistake.

The problem

WordPress saves its own address in the database. If you copy a site from olddomain.com and open it by a temporary URL, WordPress may send you back to the old domain. So you tell WordPress to use the temporary URL for now.

Steps

  1. Copy your site files and database to the new hosting.
    Temp URL 1
  2. Open the temporary URL in your browser to check that the site loads.
  3. Open File Manager in your control panel and find wp-config.php.
    temp URL 2
  4. Edit the file. Add these lines above the "That's all, stop editing" comment.
    define( 'WP_HOME', 'http://temporary-address-here' );
    define( 'WP_SITEURL', 'http://temporary-address-here' );
    Replace the text with your real temporary URL. These lines make WordPress use that address.
    Temp URL 3
    Temp URL 4
  5. Save the file.
  6. Reload the temporary URL and log in at /wp-admin.
  7. Test your pages, menus and forms.

When you are ready to go live

  1. Change your domain's nameservers or DNS records to point to your hosting. DNS is the phone book of the internet. It tells browsers where a site lives.
  2. Wait for the change to spread. This can take several hours.
  3. Remove the two lines from wp-config.php.
  4. Go to Settings, then General. Set both addresses to your real domain.
  5. Click Save Changes.
    Temp URL 5

Common problems

  • Pictures or styles are missing. Old links may still point to the old domain. Use a search and replace plugin to fix them.
  • Pages show a 404 error. Go to Settings, then Permalinks and click Save Changes.
  • The site redirects to the old domain. Check the two lines in wp-config.php.

Quick recap

  • A temporary URL lets you test a site before the domain points to it.
    Temp URL 6
  • Set WP_HOME and WP_SITEURL to that address in wp-config.php.
  • When live, remove those lines and set your real domain in the dashboard.