Have you ever wanted to change your WordPress web site or blog URL to an IP address, subdirectory, or new domain name? Why would you want to do this? Well, maybe you want to move to a new domain name. Maybe you want to setup a test or development version of WordPress in a subdirectory, another server on an IP address, or a different URL while you test and make changes. How do you do this?

It’s pretty easy, in fact so easy – you might kick yourself. All you have to is add these 2 lines to your wp-config.php file:


define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

That worked for me! There are other fixes (like going into the database), but if the easy one works – why do something that requires more work? If that doesn’t work for you – check out these other options in the WP Codex.