Update a Wordpress site url

Posted . Visible to the public.

There are a couple methods available to change the url of a WordPress site from an old address to a new one without having to manually dig through a database dump.

You can either add some code to your config.php file or your theme's functions.php file.

update_option('siteurl','http://your.site.url:port/yourblog');
update_option('home','http://your.site.url:port/yourblog');

There is also "relocate" functionality by adding define('RELOCATE',true); to your wp-config.php

Jonathan Knapp
Posted by Jonathan Knapp to Knowledge is Power! (2012-07-25 21:23)