Title: [Plugin: WP-HTML-Compression] Stripping https from links
Last modified: August 20, 2016

---

# [Plugin: WP-HTML-Compression] Stripping https from links

 *  Resolved [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/)
 * Hi,
 * Not sure how long this has been happening as we’ve only just noticed it, but 
   everytime you include a https link on a page HTML Compression strips it, leaving
   only the //. This has broken a few links, disabling the plugin fixes it.
 * Cheers,
    Ed
 * [http://wordpress.org/extend/plugins/wp-html-compression/](http://wordpress.org/extend/plugins/wp-html-compression/)

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

 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076192)
 * If your site is running in https and your links have https in them, such will
   be stripped. This is fully-working, standard code and is fine for SEO.
 *  Thread Starter [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076193)
 * It’s a http site with https anchor links to other places. It breaks links.
 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076194)
 * I’ll have to look into that, then. It’s possible that it’s a bug.
 * Could you provide me with some before and after URLs? Not example ones, but [
   https] ones that are actually causing an issue. Also include the URL of the active[
   http] page generating the errors.
 *  Thread Starter [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076195)
 * Old: `<a href="https://primaryessence.co.uk/">Primary Essence</a>`
    New: `<a 
   href="//primaryessence.co.uk/">Primary Essence</a>`
 * Cheers,
    Ed
 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076196)
 * and the URL of the page with that HTML?
 *  Thread Starter [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076197)
 * Sorry I’ve had to remove it as it was hindering a paid service. I’ll try create
   another one for you today to show you.
 *  Thread Starter [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076198)
 * Sorry for the delay, link: [http://admindemo.academyblogger.co.uk/](http://admindemo.academyblogger.co.uk/)
 * They’re in a text widget, first one is http:// second one is [https://](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/?output_format=md).
 * Thanks,
    Ed
 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076203)
 * Your other links are not shortened. You must not have WP-HTML-Compression enabled…
 *  Thread Starter [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076204)
 * It’s definitely enabled, otherwise the source wouldn’t be compressed. It leaves
   http links alone, only changing https links. There are no other plugins enabled
   that would cause it to strip the prefix, if I disable the plugin then they return.
 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076208)
 * Please provide before and after HTML. I’ll run the whole thing through some tests.
 *  Thread Starter [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076209)
 * Before:
 * `<a href="https://google.com/" target="_blank">Google HTTPS</a>`
 * After:
 * `<a href="//google.com/" target="_blank">Google HTTPS</a>`
 * Or are you wanting the entire source?
 * Thanks mate,
    Ed
 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076210)
 * The entire “before” source, yes. The reason being that your “after” source is
   very much not as it should be
 *  Thread Starter [Ed](https://wordpress.org/support/users/coopeh/)
 * (@coopeh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076211)
 * If so…
 * Before: [http://c.ed.gs/KEiW](http://c.ed.gs/KEiW)
    After: [http://c.ed.gs/KEC0](http://c.ed.gs/KEC0)
 * Ed
 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076212)
 * Works perfectly fine here. Thoroughly tested it and could not reproduce your 
   issue.
 * The only issue I ran into was with http images/stylesheets/scripts on an https
   site where WebKit would do a secure semi-redirect to http to allow those items
   to load. This, however, did not affect the the shortened links at all.
 *  Plugin Author [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076213)
 * The only way I can reproduce this issue is by manually setting a custom site 
   URL in the class constructor to https when the site is running in http.

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

The topic ‘[Plugin: WP-HTML-Compression] Stripping https from links’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-html-compression.svg)
 * [WP-HTML-Compression](https://wordpress.org/plugins/wp-html-compression/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-html-compression/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-html-compression/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-html-compression/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-html-compression/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-html-compression/reviews/)

 * 15 replies
 * 2 participants
 * Last reply from: [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-html-compression-stripping-https-from-links/#post-3076213)
 * Status: resolved