Support » Plugin: W3 Total Cache » HTML minify breaks forms

  • Resolved Plan9

    (@plan9) HTML minify breaks forms. I think it is because it is stripping out quotation marks from CSS – but I’m not sure. Previous versions of W3TC did not have this problem.

    In my case some pre-populated text in a search form does not disappear when someone starts typing into the search box.

    I did post this before and was told a workaround would be posted – but then nothing happened. I paid for the premium licence but there doesn’t seem to be any support included so I’m posting here as the issue affects the free version as well.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Marko Vasiljevic



    I spoke with the team and after looking into this it appears that you have another issue, not related to removing quotations because that’s perfectly correct HTML. Again see this article
    We could help you to find out what causes the problem, but in this case, as this is time-consuming I can offer you our professional support.

    Does W3 Total Cache strip double quotes from minified HTML now? Pretty sure it didn’t used to do that.

    Couple of updates ago (I use the free version) there was a ‘bug’ stripping both single and double quotes out of the minified HTMl code and this broke functionality on my sites (had to downgrade to an older version of the plugin otherwise some inline javascript broke).

    The single quote issue appears to be fixed (no longer breaking the inline javascript) in the latest version (, but some (not all) double quotes are still stripped and though functionality remains I don’t like it.

    View source of any page at (runs under version and the code in quote terms is a mess!

    All HTML code when unminified is either single or double quoted, but W3 Total Cache is removing some of the double quotes, looks random! I really don’t want the double quotes stripped from my code.

    Based on Marko’s reply above it sounds like the plugin is supposed to do this! Is that right?

    I can confirm some strange issues with html minify + jquery.

    It happens in my case like this:

    A) HTML minify disabled
    -> first page + subsequent ajax pages:

    innerHTML: "↵<a href="https://URL">Read More</a>"
    innerText: "READ MORE"

    B) HTML minify ENABLED
    -> first page

    innerHTML: "↵<a href="https://URL">Read More</a>"
    innerText: "READ MORE"

    -> subsequent ajax pages:

    innerHTML: "↵<a href="https://URL"></a>Read More"
    innerText: "↵Read More"

    Please notice that Read More is outside of “A”

    Plugin Contributor Marko Vasiljevic



    The HTML is valid and this feature makes page load even smaller, so faster and better for mobile visitors. Not all quotes are removed as HTML requires quotes when there’s a space in the value. Maybe you don’t like it, but nobody cares how the HTML looks, they only care about your website working fast.
    Once again please check the article from google chrome engine project =>

    @vmarko You’re annoying to claim that HTML minify in w3 total cache is so perfect. I have exactly the same problem as @fliespl (stil in version, although maybe he did not fully explain the nature of the problem. The point is that if the URL in the href attribute ends with a “/” character (being the last attribute in tag), after minimizing this character is in a place that suggests that anchor is a self-closing tag.

    <a href=""> Link </a>
    will be minimized to:
    <a href=> Link </a>
    which means that the anchor will end before the word “Link”!

    • This reply was modified 3 years, 2 months ago by jimmy4o4.
    Plugin Contributor Marko Vasiljevic


    Hello @jimmy4o4,

    We’ve confirmed that there is an issue with HTML minify in some cases and we’ve provided a fix.
    Please check this topic

    Is it really fixed though?

    It’s still ending a hrefs with /> on 0.10.1 ending up with a broken link in my case.

    Read More

    Even REC says that there should be at least a space if unquoted and ending with slash/solidus.

    If an attribute using the unquoted attribute syntax is to be followed by another attribute or by the optional U+002F SOLIDUS character (/) allowed in step 6 of the start tag syntax above, then there must be a space character separating the two.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘ HTML minify breaks forms’ is closed to new replies.