Updating WordPress GUIDs in MySQL

When moving from a stage site to production, sometimes it’s necessary to update the GUIDs. Doing a quick REPLACE() is an easy way to accomplish this.

UPDATE wp_posts
SET guid = REPLACE(guid, 'http://stage.somesite.com', 'http://www.somesite.com')
WHERE guid LIKE '%http://stage.somesite.com%'

Last updated by at .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.