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
- No database edits required
- No risk of breaking URLs
- Works with HTTPS and SSL certificates
Preview WordPress using the hosts file
- Find the server IP address from your hosting welcome email.
- Edit your local hosts file on your computer.
- Add a line mapping your domain to the server IP.
Example:
123.123.123.123 mydomain.com
123.123.123.123 www.mydomain.comSave 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.
- Log in to your hosting control panel.
- Open phpMyAdmin.
- Select the WordPress database.
- Open the wp_options table.
- 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 ?
- Call on: 01480 26 00 00
- Sales 9am to 5pm - Support 24/7
- Email: sales@fast2host.com