I’ve logged into my site in HTTPS and I’m editing on a specific post. I’ve dragged an image to the edit window and am now inserting an image.
The thing is WordPress is inserting the image as HTTP instead of HTTPS. It shows the URL as HTTP clearly and uneditable.

- Is there a way to change this value to HTTPS? I’m guessing no.
- Is there a way to tell WordPress to enter the relative URL instead of absolute URL? I’m guessing no too.
With SSL Certificates now free to any website I think this issue may come up more.
-
Change the site URL to be HTTPS based instead of HTTP. In other words go fully HTTPS on your site. If you need mixed content solution for serving your HTML both as HTTP and HTTPS you will need some dynamic detection and manipulation of URLs in the contents or serve as protocol neutral url.
-
very bad idea. The best you can get is protocol neutral Urls.
You can try something like
add_filter('the_content','wpse_211864',1000,1);
// remove 'http:' part from any mention of the site url
function wpse_211864($content) {
return str_replace(siteurl(),str_replace('http:','',siteurl()),$content);
}