Yeah, we’re all lazy sometime. I recently added HTTPS support to this blog but the content saved might contain http links or image addresses. Instead of updating the whole database, you can just add this to your theme functions.php file :
1 2 3 4 5 6 7 8 9 |
//Custom to handle embedded content without https function force_https_the_content($content) { if ( is_ssl() ) { $content = str_replace( 'http://blog.louwii.fr', 'https://blog.louwii.fr', $content ); } return $content; } add_filter('the_content', 'force_https_the_content'); |
Problem solved ! I know, it’s not very clean, but it’s working great.