WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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??


share|improve this question
up vote 4 down vote accepted

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

share|improve this answer
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
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
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
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 posting your answer, you agree to the privacy policy and terms of service.

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