Title: [Plugin: WordPress HTTPS] Problem with images
Last modified: August 19, 2016

---

# [Plugin: WordPress HTTPS] Problem with images

 *  Resolved [krbvroc1](https://wordpress.org/support/users/krbvroc1/)
 * (@krbvroc1)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/)
 * I believe there is a bug in this plugin.
 * First off, I have FORCE_SSL_ADMIN enabled in wp-config.php so that all stuff 
   in the admin area is secure.
 * I also have the ‘Internal HTTPS Elements’ plugin option enabled.
 * What happens is that I create a new page for the site. In this new page, I insert
   a photo. It appears that this plugin is forcing the image url to be https rather
   than http. Even thought the page will be served from http, the embedded image
   is https. I’m wondering if the plugin is confused because the image is inserted
   during a SSL session?
 * ps. If I disable ‘Internal HTTPS Elements’ this does not happen, but that is 
   an important option to remain enabled.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812272)
 * Well, that makes sense.
 * Right now, the plugin processes elements on the front-end and the admin panel.
   I’m sure it’s processing the post code and modifying it as well. I’ll have to
   make it so that when processing the back-end, it only fixes stylesheets and scripts,
   and just leaves images and such alone. That should take care of it.
 * If you’re feeling daring, you can modify the plugin and give it a shot.
 * Replace line 176 in wordpress-https.php:
 *     ```
       preg_match_all('/\<(script|link|img|input|form|embed|param)[^>]+((http|https):\/\/[\/-\w\.#]+)[^>]+>/im', $buffer, $matches);
       ```
   
 * With this:
 *     ```
       if (is_admin()) {
        preg_match_all('/\<(script|link)[^>]+((http|https):\/\/[\/-\w\.#]+)[^>]+>/im', $buffer, $matches);
       } else {
        preg_match_all('/\<(script|link|img|input|form|embed|param)[^>]+((http|https):\/\/[\/-\w\.#]+)[^>]+>/im', $buffer, $matches);
       }
       ```
   
 * That should do it. If you try it, let me know if it works. When I have more time,
   I’ll test it myself and if it works, I’ll get it into the next update.
 *  Thread Starter [krbvroc1](https://wordpress.org/support/users/krbvroc1/)
 * (@krbvroc1)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812361)
 * I updated the source code and this does appear to work, thank you.
 *  Anonymous User 6488573
 * (@anonymized-6488573)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812427)
 * That didn’t fix it for me, even with “Internal HTTPS Elements” ticked off
    Also,
   when viewing my media library, all the links start with https.
 * Is it because the links are hardcoded in the DB???
 *  Anonymous User 6488573
 * (@anonymized-6488573)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812428)
 * I’ve fixed all the guids in the database, but it didn’t change anything…
 * And it’s not just the image link, but also the link URL
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812437)
 * Hey Olivier,
 * I’ve tried to reproduce your problem, but I can not. If you’d like, I can take
   a look at your website. You can email me directly at mike[at]mvied[dot]com.
 * Thanks,
    Mike
 *  [ccolotti](https://wordpress.org/support/users/ccolotti/)
 * (@ccolotti)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812476)
 * Did this fix make it into a release? I have been getting broken links since disabling
   SSL due to a required cert change. I was curious how some pictures were inserted
   as HTTPS until I saw this post that it was related to the plugin. It would be
   nice to know if this is now fixed so picture inserts will be HTTP while the inspect
   internal elements remains checked.
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812477)
 * Hey ccolotti,
 * As far as I know this is fixed.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: WordPress HTTPS] Problem with images’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-https_bec2c9.svg)
 * [WordPress HTTPS (SSL)](https://wordpress.org/plugins/wordpress-https/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-https/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-https/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-https/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-https/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-https/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [mvied](https://wordpress.org/support/users/mvied/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-problem-with-images/#post-1812477)
 * Status: resolved