Skip to content

Instantly share code, notes, and snippets.

@sokratisg
Created May 24, 2015 21:52
Show Gist options
  • Save sokratisg/5f7df1cb297f441376df to your computer and use it in GitHub Desktop.
Save sokratisg/5f7df1cb297f441376df to your computer and use it in GitHub Desktop.
WP convert http to https
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