Update Wordpress DB to new domain

/ Published in: MySQL
Save to your folder(s)

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.

Copy this code and paste it in your HTML
  1. -- change wp_ to your database's table prefix
  2. -- change oldurl, newurl
  3. -- oldurl is the one in the database already
  4. -- newurl might be your localhost or development address
  6. UPDATE wp_options SET option_value = REPLACE (option_value, 'http://oldurl','http://newurl');
  8. UPDATE wp_posts SET guid = REPLACE (guid,'http://orldurl','http://newurl');

URL: www.owlandfox.com

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.