voku/html-min
HTML Compressor and Minifier
5.0.0
5.2M downloads/mo
#2364 most downloaded on Packagist
voku/HtmlMin
What this package is like to depend on
Last release 4 months ago
23 Apr 2026
Ships unpredictably
gaps range from 2 weeks to 2.0 years
Most releases are documented
notes for 44 of 63 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
63 releases · first in 2016
1 release in the last 12 months
see the full history below
Release timeline
62 releases · Oct 2016 to Apr 2026Releases
latest 60 of 63-
5.0.023 Apr 2026Release notes
Open source →- add
doRemoveCommentsOnly()for removing regular HTML comments without applying other minification changes - add opt-in inline JavaScript minification via
doMinifyJavaScript()(usestedivm/jshrink) - add
doRemoveDataAttributes()option to drop alldata-*attributes (disabled by default) - expand
doRemoveOmittedHtmlTags()to cover more WHATWG optional-tag rules (html,head,body,colgroup,tbody,rt, newerpfollowers, andhrhandling foroption/optgroup) - improve same-domain URL handling:
doMakeSameDomainsLinksRelative()now accepts a plaintrueflag; use the new fluentsetLocalDomains(array)helper to configure domains separately - fix PHP 8.5 deprecation warnings: replace
SplObjectStorage-based observer registration with an array-keyed map to avoid duplicates - fix optional-tag omission around comments, protected comments, autonomous custom elements, and blocked
bodystarts (meta,link,noscript,script,style,template) - fix optional-tag omission when preserving inter-tag whitespace or comments so table sections and sibling tags still round-trip to the same DOM
- fix
<script type="application/ld+json">whitespace minification preserving valid JSON - fix nested protected child-node restoration (nocompress blocks, special script tags)
- fix whitespace around inline tags (
<b>,<em>,<i>,<strong>,<u>) not being preserved correctly - fix standalone
<head>and<body>fragment closing-tag omission - fix UTF-8 non-breaking space characters being incorrectly stripped
- fix PHP 8.3
idattribute handling triggering a type error - fix
text/htmlscript-template tags leaking internal simple_html_dom placeholders - fix
xml:langattribute being lost and trim script-tag whitespace for PHP 7.x compatibility - internal: extract
patchSimpleHtmlDomPlaceholders()as an idempotent Reflection-based method for simple_html_dom v5 compatibility - upgrade
voku/simple_html_domdependency to^5.0; addtedivm/jshrink ^1.8.1; require PHP>=7.1 - update CI matrix to cover PHP 7.1 – 8.5; refresh GitHub Actions (checkout v6, cache v5, upload-artifact v7, codecov v6)
- add
-
4.5.125 May 2024Release notes
Open source →- "fix SimpleHtmlDom::__construct(): Argument #1 ($node) must be of type DOMNode, null given" (thanks @frugan-dev)
-
4.5.009 Jun 2022Release notes
Open source →- added possibility overwrite special script tags on minify process (thanks @hryvinskyi)
- fix some PHP 8.1 type errors
-
4.4.1013 Mar 2022Release notes
Open source →- use a new version of "voku/simple_html_dom" (4.8.5)
- phpstan reported errors fixed
-
4.4.909 Mar 2022Release notes
Open source →- optimize regex for gigantic inputs
- use a new version of "voku/simple_html_dom" (4.8.4)
-
4.4.811 Aug 2020Release notes
Open source →- remove content before "<!doctype.*>", otherwise DOMDocument cannot handle the input
- use a new version of "voku/simple_html_dom" (4.7.22)
-
4.4.710 Aug 2020 -
4.4.608 Aug 2020 -
4.4.505 Aug 2020 -
4.4.405 Aug 2020 -
4.4.306 Apr 2020Release notes
Open source →- fix "domNodeClosingTagOptional()" -> fix logic of detecting next sibling dom node
-
4.4.205 Apr 2020Release notes
Open source →- fix "domNodeClosingTagOptional()" -> do not remove "</p>" if there is more content in the parent node
-
4.4.105 Apr 2020 -
4.4.005 Apr 2020Release notes
Open source →- add support for removing more default attributes
- add "doRemoveDefaultTypeFromButton()"
- add "doRemoveDefaultMediaTypeFromStyleAndLinkTag()"
- add "doRemoveDeprecatedTypeFromStyleAndLinkTag()"
- add "overwriteTemplateLogicSyntaxInSpecialScriptTags()"
- use a new version of "voku/simple_html_dom" (4.7.15)
-
4.3.022 Mar 2020Release notes
Open source →- add "isHTML4()"
- add "isXHTML()"
- fix "remove deprecated script-mime-types"
- use a new version of "voku/simple_html_dom" (4.7.13)
-
4.2.005 Mar 2020Release notes
Open source →- add "doKeepHttpAndHttpsPrefixOnExternalAttributes(bool)": keep http:// and https:// prefix for external links | thanks @abuyoyo
- add "doMakeSameDomainsLinksRelative(string[] $localDomains)": make the local domains relative | thanks @abuyoyo
- optimized "optgroup"-html compressing
- use a new version of "voku/simple_html_dom" (4.7.12)
-
4.1.006 Feb 2020Release notes
Open source →- add "doRemoveHttpsPrefixFromAttributes()": remove optional "https:"-prefix from attributes (depends on "doOptimizeAttributes(true)")
-
4.0.718 Nov 2019 -
4.0.627 Oct 2019Release notes
Open source →- fix: fix regex for self-closing tags
- optimize performance via "strpos" before regex
-
4.0.519 Sep 2019 -
4.0.417 Sep 2019 -
4.0.317 Sep 2019 -
4.0.213 Sep 2019 -
4.0.130 Aug 2019Release notes
Open source →- optimize unicode support
- fix: remove unnecessary </source> closing tag #40
- fix: bad minify text/x-custom-template #38
-
4.0.017 Aug 2019Release notes
Open source →- use interfaces in the "HtmlMinDom"-Observer
-> this is a BC, but you can simply replace this classes in your observer implementation:
---> "SimpleHtmlDom" with "SimpleHtmlDomInterface
---> "HtmlMin" with "HtmlMinInterface"
-
3.1.819 Jun 2019Release notes
Open source →- fix / optimize: "doRemoveOmittedQuotes" -> support for "<html ⚡>" via SimpleHtmlDom
-
3.1.708 Jun 2019 -
3.1.604 Mar 2019 -
3.1.528 Feb 2019Release notes
Open source →- fix: keep newlines in e.g. "pre"-tags
- fix: remove newlines from "srcset" and "sizes" attribute
-
3.1.428 Feb 2019Release notes
Open source →- fix: get parent node
- code-style: remove "true" && "false" if return type is bool
-
3.1.306 Jan 2019 -
3.1.228 Dec 2018Nothing published for this version
-
3.1.128 Dec 2018Nothing published for this version
-
3.1.027 Dec 2018Release notes
Open source →- add "HtmlMinDomObserverInterface" (+ HtmlMin as Observable)
- use phpcs fixer
-
3.0.601 Dec 2018 -
3.0.517 Oct 2018 -
3.0.407 Oct 2018Release notes
Open source →- update vendor (voku/simple_html_dom >= v4.1.6) + option for keep broken html
-
3.0.308 May 2018 -
3.0.212 Feb 2018 -
3.0.129 Dec 2017 -
3.0.022 Dec 2017Release notes
Open source →- remove "Portable UTF-8" as required dependency
-> this is a breaking change, without any API changes
-
2.0.422 Dec 2017 -
2.0.322 Dec 2017Release notes
Open source →- fix "Minifier removes spaces between tags"
- fix "Multiple horizontal whitespace characters not collapsed"
-
2.0.210 Dec 2017Release notes
Open source →- try to fix "Minifier removes spaces between tags" v2
- disable "doRemoveWhitespaceAroundTags" by default
-
2.0.110 Dec 2017 -
2.0.003 Dec 2017Release notes
Open source →- drop support for PHP < 7.0
- use "strict_types"
- doRemoveOmittedQuotes() -> remove quotes e.g. class="lall" => class=lall
- doRemoveOmittedHtmlTags() -> remove ommitted html tags e.g. <p>lall</p> => <p>lall
-
1.0.922 Sep 2017Nothing published for this version
-
1.0.809 Sep 2017Nothing published for this version
-
1.0.709 Sep 2017Nothing published for this version
-
1.0.609 Sep 2017Nothing published for this version
-
1.0.512 May 2017Nothing published for this version
-
1.0.418 Mar 2017Nothing published for this version
-
1.0.307 Dec 2016Nothing published for this version
-
1.0.201 Dec 2016Nothing published for this version
-
1.0.101 Dec 2016Nothing published for this version
-
1.0.030 Nov 2016Nothing published for this version
-
0.0.723 Oct 2016Nothing published for this version
-
0.0.623 Oct 2016Nothing published for this version
-
0.0.517 Oct 2016Nothing published for this version
-
0.0.4no dateNothing published for this version