How to change all the guid in posts table?

Recently I have transferred my WordPress from development server to live server. I noticed that I have to change all the “guid” with live domain url. Is there any mysql query or simple function available to change it easily.

6 s
6

It should be something like:

UPDATE wp_posts SET guid = REPLACE(guid, 'oldurl.com', 'newurl.com') WHERE guid LIKE 'http://oldurl.com/%';
  • oldurl.com – Previous URL shown in wordpress settings > general options
  • newurl.com – New URL

Leave a Comment