Skip to content

Instantly share code, notes, and snippets.

@timwright12
Created February 25, 2016 16:57
Show Gist options
  • Save timwright12/409cd6394c6d796e45c1 to your computer and use it in GitHub Desktop.
Save timwright12/409cd6394c6d796e45c1 to your computer and use it in GitHub Desktop.
UPDATE wp_posts SET guid=replace(guid, 'http://old.url', 'http://new.url');
UPDATE wp_posts SET post_content=replace(post_content, 'http://old.url', 'http://new.url');
@timwright12
Copy link
Author

first i check the table prefix before i run the query

[11:58]
to make sure it is actually wp_

[11:59]
then look at the values in the guid column

[11:59]
of the posts table

[11:59]
to get the exact URL(s) could be multiple versions

[11:59]
actually the very first step is to copy a dump of the wp_posts data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment