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 documentation 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://example.com ?



1 Answer 1


"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.

  • 1
    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, 2012 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, 2012 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. Mar 4, 2012 at 21:05
  • @Soulseekah btw what is sed ??
    – alex
    Mar 13, 2012 at 4:57
  • 2
    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. Oct 13, 2015 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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