Skip to content

Instantly share code, notes, and snippets.

@thoriqmacto
Last active May 28, 2018 12:32
Show Gist options
  • Save thoriqmacto/4ec48048369daf4a42b7691f2cdb1b78 to your computer and use it in GitHub Desktop.
Save thoriqmacto/4ec48048369daf4a42b7691f2cdb1b78 to your computer and use it in GitHub Desktop.
[sql] Update Specific URL Inside wp_posts Table
UPDATE wp_posts SET `post_content` = REPLACE (`post_content`, 'src="http://www.your-site.com"', 'src="https://www.your-site.com"');
UPDATE wp_2_posts SET `post_content` = REPLACE (`post_content`, 'src="http://www.your-site.com"', 'src="https://www.your-site.com"');
UPDATE wp_posts SET `guid` = REPLACE (`guid`, 'http://www.your-site.com', 'https://www.your-site.com') WHERE post_type = 'attachment';
UPDATE wp_2_posts SET `guid` = REPLACE (`guid`, 'http://www.your-site.com', 'https://www.your-site.com') WHERE post_type = 'attachment';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment