I’ve added the following code to functions.php so that the page’s links are automatically set as https links.
add_filter('upload_dir', function($uploads) {
$uploads['url'] = preg_replace('#^http://#i', 'https://', $uploads['url']);
$uploads['baseurl'] = preg_replace('#^http://#i', 'https://', $uploads['baseurl']);
return $uploads;
});
That mostly works, but there are still some links that are still referring to the http URL. I can’t see any pattern to it. What can I do to fix the issue?
I installed and activated the plugin, but it doesn’t seem to make any difference. Many images and links are still using http.
For example:
https://smasolutions.it/contact-us/
The image on the page is called using http, not https. This only seems to affect some images and links on some pages, though.
Any ideas?
Hey!
Please try this plugin instead: https://wordpress.org/plugins/wordpress-https/
Best regards,
Ismael