11

Done this before and i am still wondering what to do with the wp_posts => guid content, which has reference to http://localhost

But at wordpress.org http://codex.wordpress.org/Changing_The_Site_URL it clearly states:

Never, ever, change the contents of the GUID column, under any circumstances.

But as i understand it is just to unique identify your posts globally. But as more people would have http://localhost in their guid.

So can i safely replace http://localhost with http://www.mydomain.com??

regards

6

"GUID" stands for "Globally Unique Identifier" mainly used by feeds to tell if that specific post was shown on the feed before or not, even if you change domains.

When developing on local host and the moving to live (+1 just for that BTW) and no feed reader/burner has read your feeds and only if that is the case it's OK to change it and start fresh on your new live host.

  • tx, still not able to move from local to live in 5 min, ;) For others i used UPDATE wp_posts SET guid = REPLACE (guid, 'http://localhost', 'http://www.mydomain.com'); – alex Mar 4 '12 at 17:53
  • 2
    Using sed on a dump to replace hosts will ensure that all your menus, options, etc. are ready for production as well. – soulseekah Mar 4 '12 at 17:56
  • 2
    Yes, I also normally dump the DB, then globally replace in the dump before restoring it. I also just noticed that under the Codex advice on moving multi-site installs, there's now a link to a specialised search and replace tool that copes with safely replacing in PHP serialised DB data, specifically for doing things like this. – Matt Gibson Mar 4 '12 at 21:05
  • @Soulseekah btw what is sed ?? – alex Mar 13 '12 at 4:57
  • 1
    The wp command line tool is great for this: wp --path=path/to/wp search-replace 'dev-domain.com' 'www.production-domain.com' If you want to avoid changing the guid field, then add --skip-columns=guid. – Quinn Comendant Oct 13 '15 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.