Skip to content

Instantly share code, notes, and snippets.

@IlanVivanco
Last active March 16, 2021 12:56
Show Gist options
  • Save IlanVivanco/01d84de5ca9a56e76b0ae63e7970690f to your computer and use it in GitHub Desktop.
Save IlanVivanco/01d84de5ca9a56e76b0ae63e7970690f to your computer and use it in GitHub Desktop.
Replace WP relative URLs images
UPDATE
wp_posts
SET
post_content = (
REPLACE(post_content, 'src="http://', 'src="//')
)
WHERE
INSTR(post_content, 'jpeg') > 0
OR INSTR(post_content, 'jpg') > 0
OR INSTR(post_content, 'gif') > 0
OR INSTR(post_content, 'png') > 0
OR INSTR(post_content, 'svg') > 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment