Last active
March 16, 2021 12:56
-
-
Save IlanVivanco/01d84de5ca9a56e76b0ae63e7970690f to your computer and use it in GitHub Desktop.
Replace WP relative URLs images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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