Skip to content

Instantly share code, notes, and snippets.

@mglaman
Last active November 27, 2025 13:05
Show Gist options
  • Select an option

  • Save mglaman/5670530 to your computer and use it in GitHub Desktop.

Select an option

Save mglaman/5670530 to your computer and use it in GitHub Desktop.
Migrating WordPress websites, changing guid for posts so attachments and routes have proper URL.
UPDATE wp_posts SET guid =
REPLACE(
guid,
"localhost/example",
"example.com"
),
post_content =
REPLACE(
post_content,
"localhost/example",
"example.com"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment