Fix mixed content in WordPress

Written at lunch time in English • Tags: , ,

TIL: Switching a WordPress site to HTTPS will result in mixed content. Database surgery needed to fix.

UPDATE `wp_posts`
SET `post_content` =
REPLACE(
    `post_content`,
    'http://mysite.example.com',
    'https://mysite.example.com'
)
WHERE `post_content`
LIKE '%http://mysite.example.com/%'

Let’s Encrypt is cool.