Last active
June 15, 2017 14:05
-
-
Save jeremyhalin/671316e060b2e98699281966fc64da14 to your computer and use it in GitHub Desktop.
Replace images URL to HTTPS ones in WordPress
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; | |
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; | |
UPDATE wp_postmeta | |
SET meta_value=(REPLACE (meta_value, 'iframe src="http://','iframe src="//')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment