So you’ve just bought hosting and a domain name and want to set up a WordPress site while waiting for the domain registration or DNS propagation. WordPress relies on the domain name resolving to your web hosting account’s IP address to function properly, so if the domain isn’t pointing to the WordPress install, we have to tell WordPress to use the dedicated IP address of the hosting package or VPS server until things work right with the domain.
Modify WordPress Site URL
Once WordPress is installed you have a few options for modifying the site url. Let’s get started.
Option 1: Edit wp-config.php
In the root directory of your WordPress installation (public_html on a hosting package (or /var/www/html on a VPS, depending on OS and setup) will be the wp-config.php file.
In cPanel use the File Manager to navigate to public_html (or the subdomain WordPress is installed in), click the wp-config.php file and click Edit in the file manager.
– or –
In ssh, cd to /var/www/html or to the document root where WordPress is installed and Edit this file in your favorite Text Editor. For example, type nano wp-config.php to open this file so that you can make some edits.
Add these two lines to the config, the options will not already be there:
define( 'WP_HOME', 'http://192.168.2.5/' ); define( 'WP_SITEURL', 'http://192.168.2.5/' );
Save, and exit, and refresh the WordPress page
Option 2: Modify The WordPress database
On a cPanel-based hosting you can easily edit the WordPress database with phpMyAdmin
Instead of navigating to the users table, though, you’ll need to navigate to the _options table in phpMyAdmin
Then find the siteurl and home fields (they’re typically near the top but may not be) and edit each of them from “http://yourdomainname.com/” to “http://192.168.2.5”
Click edit to the left of the field and change the domain to the IP address (but leave the http[s]:// and any trailing / or /wp)
Then click Go when finished.
Repeat this for the ‘home’ row in this table.
Once this is done you can exit phpMyAdmin and refresh your wordpress page(s).
– or –
On a VPS you would have to use MySQL from the command line. Here is an example below:
# mysql > show databases; > use wordpressdatabase; > update wp_options set siteurl = REPLACE(siteurl,"http://yourdomainname.com/","http://192.168.2.5/"); > update wp_options set home = REPLACE(home,"http://yourdomainname.com/","http://192.168.2.5/"); > quit;
- Installing WordPress using Softaculous
- How to Manually Migrate a WordPress Installation to Hostwinds
- Pre Migration Checklist
- Submit Migration Request
- What Is The Migration Process?
- Hostwinds Migration Policy
- How To Edit A Hosts File