When you first install WordPress you usually don’t want to set the Site URL to the full public domain until development is complete. When this is the case you would set the site URL for wordpress to be a test domain or perhaps just the ip address of your server.
When it comes time to go live in production you need to switch the base domain. Unfortunately WordPress doesn’t give you a configuration screen to do this.
The Site URL and Site Home Page setting are both stored in the database and need to be updated for WordPress to operate correctly. Thankfully there is an easier way than updating the database correctly.
Simply navigate to your theme directory and add these lines to the functions.php file of your theme:
Then open a new browser window and navigate to the existing domain/ip address for your site.
Now you can navigate back to your theme directory and remove those two lines and your done