Force SSL for WordPress Media Attachments

Case scenario: you have certain pages on your site that force SSL but not all. You notice that the culprits (i.e. pesky buggers that are still being served using http://) are all coming from the uploads folder and are in the media library. https://gist.github.com/d81af526fa6b6f2808f9 Cheers to the anonymous Ludovic who came up with this seemingly obvious solution to a problem Google was stubbornly refusing to help me with.

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to view allowed tags

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.