Return to Snippet

Revision: 32952
at October 5, 2010 07:03 by timkinnane


Updated Code
-- change wp_ to your database's table prefix
-- change oldurl, newurl
-- oldurl is the one in the database already
-- newurl might be your localhost or development address

UPDATE wp_options SET option_value = REPLACE (option_value, 'http://oldurl','http://newurl');

UPDATE wp_posts SET guid = REPLACE (guid,'http://orldurl','http://newurl');

Revision: 32951
at October 5, 2010 04:09 by timkinnane


Initial Code
// change wp_ to your databases table prefix
// change oldurl, newurl
// oldurl is the one in the database already
// newurl might be your localhost or development address

UPDATE wp_options SET option_value = REPLACE (option_value, 'http://oldurl','http://newurl');

UPDATE wp_posts SET guid = REPLACE (guid,'http://orldurl','http://newurl');

Initial URL
www.owlandfox.com

Initial Description
If you\'ve got a Wordpress install that\'s changed domain or you\'re making a local or development copy, you\'ll need to update the Wordpress DB tables  with the new URL.\r\nThe first step is the options table, with siteurl and homeurl. The posts also store the URL, but if the main options are correct WP will figure it out, though I update them too just in case.

Initial Title
Update Wordpress DB to new domain

Initial Tags
mysql, database, wordpress

Initial Language
MySQL