Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Created September 17, 2013 07:09
Show Gist options
  • Save remcotolsma/6590941 to your computer and use it in GitHub Desktop.
Save remcotolsma/6590941 to your computer and use it in GitHub Desktop.
SELECT
CONCAT(
'UPDATE wp_posts SET post_content = REPLACE(post_content, ' ,
QUOTE(meta.meta_value) , ', ' ,
QUOTE(post.guid) , ');'
)
FROM
wp_posts AS post
RIGHT JOIN
wp_postmeta AS meta
ON
post.ID = meta.post_id
AND
meta.meta_key = '_import_url'
WHERE
post.guid != '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment