Wordpress On Temporary URL

How to Develop a WordPress Site Before DNS Changes Go Live

When migrating WordPress or setting up a new site before your domain points to the server, you may need a way to preview and work on the site before DNS changes take effect.

Common issues during this stage include broken images, missing styles, and being redirected away from the WordPress admin area.

Recommended modern method (best practice)

The preferred and safest way to preview a WordPress site before DNS changes is by using a hosts file override on your computer.

Why this method:
- No database edits required
- No risk of breaking URLs
- Works with HTTPS and SSL certificates
Preview WordPress using the hosts file
  1. Find the server IP address from your hosting welcome email.
  2. Edit your local hosts file on your computer.
  3. Add a line mapping your domain to the server IP.

Example:

123.123.123.123 mydomain.com
123.123.123.123 www.mydomain.com

Save the file, clear your browser cache, then visit your domain normally in a browser.

Alternative method (database URL change)
Legacy approach: Editing the database directly should only be used if hosts file editing is not possible.

If you must change the site URL temporarily, update the siteurl and home values in the WordPress database.

  1. Log in to your hosting control panel.
  2. Open phpMyAdmin.
  3. Select the WordPress database.
  4. Open the wp_options table.
  5. Edit the values for siteurl and home.
siteurl = http://server-ip-address/
home = http://server-ip-address/
Important: This method can cause mixed content warnings and login issues when SSL is enabled.
After DNS changes are complete

Once your domain resolves to the server:

  • Remove the hosts file entries (if used).
  • Log in to WordPress admin.
  • Go to Settings - General.
  • Confirm WordPress Address and Site Address are set to your domain.
Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 7810

Need more information or have a question ?