Force WordPress Media button to insert https:// links

4 Comments

  1. HI,

    This didn’t work for me. After moving to SSL the add media button on post.php page shows blank thumbnails (no preview image) and will insert img src links into the editor with http protocol. Struggling to find a way for the media management tool on post.php to show and handle images properly.

    The odd thing is that upload.php works fine and shows all thumbnail images.

    I’ve tried all the default troubleshooting steps (plugins off, wordpress reinstall, cache off).

    Any idea what could be going on? This issue has plagued me for over a year since I went to ssl and has persisted through the versions of wordpress.

  2. Update:
    When I originally moved over to https I added the following to config.php

    `define(‘WP_SITEURL’, ‘https://siteurl.com’);`

    I removed this and in settings > general and the value for my site address changed back to http://siteurl.com.

    I changed this to https, saved the changes and hey presto, the add media button is up an running – all media thumbnails are showing and when I add media to the posts and it is adding the correct protocol for my site.

    1. Glad you got this figured out Oliver. Since writing this post, WordPress now uses srcset rather than img for the final output. I haven’t tested the differences from the admin side though.

Leave a Reply to Oliver Cancel reply

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

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