PHPackages                             afbora/kirby-minify-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. afbora/kirby-minify-html

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

afbora/kirby-minify-html
========================

Enable minify HTML output for Kirby

2.2.1(9mo ago)3816.0k↓25%31MITPHPPHP ^8.0

Since Sep 19Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/afbora/kirby-minify-html)[ Packagist](https://packagist.org/packages/afbora/kirby-minify-html)[ Docs](https://github.com/afbora/kirby-minify-html)[ RSS](/packages/afbora-kirby-minify-html/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (14)Used By (1)

Kirby Minify HTML
=================

[](#kirby-minify-html)

Enable minify HTML output for Kirby 3 and 4.

Installation
------------

[](#installation)

### Installation with composer

[](#installation-with-composer)

```
composer require afbora/kirby-minify-html

```

### Add as git submodule

[](#add-as-git-submodule)

```
git submodule add https://github.com/afbora/kirby-minify-html.git site/plugins/kirby-minify-html

```

Options
-------

[](#options)

The default values of the package are:

OptionDefaultValuesDescriptionafbora.kirby-minify-html.enabledtruebooleanEnable/disable minifyafbora.kirby-minify-html.ignore\[\]arrayIgnore minifying for the selected templatesafbora.kirby-minify-html.options\[\]arrayMinify options \*### Available Minify Options

[](#available-minify-options)

OptionDescriptiondoOptimizeViaHtmlDomParseroptimize html via "HtmlDomParser()"doRemoveCommentsremove default HTML comments (depends on "doOptimizeViaHtmlDomParser(true)")doSumUpWhitespacesum-up extra whitespace from the Dom (depends on "doOptimizeViaHtmlDomParser(true)")doRemoveWhitespaceAroundTagsremove whitespace around tags (depends on "doOptimizeViaHtmlDomParser(true)")doOptimizeAttributesoptimize html attributes (depends on "doOptimizeViaHtmlDomParser(true)")doRemoveHttpPrefixFromAttributesremove optional "http:"-prefix from attributes (depends on "doOptimizeAttributes(true)")doRemoveHttpsPrefixFromAttributesremove optional "https:"-prefix from attributes (depends on "doOptimizeAttributes(true)")doKeepHttpAndHttpsPrefixOnExternalAttributeskeep "http:"- and "https:"-prefix for all external linksdoMakeSameDomainsLinksRelativemake some links relative, by removing the domain from attributesdoRemoveDefaultAttributesremove defaults (depends on "doOptimizeAttributes(true)"doRemoveDeprecatedAnchorNameremove deprecated anchor-jump (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedScriptCharsetAttributeremove deprecated charset-attribute - the browser will use the charset from the HTTP-Header, anyway (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedTypeFromScriptTagremove deprecated script-mime-types (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedTypeFromStylesheetLinkremove "type=text/css" for css links (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedTypeFromStyleAndLinkTagremove "type=text/css" from all links and stylesdoRemoveDefaultMediaTypeFromStyleAndLinkTagremove "media="all" from all links and stylesdoRemoveDefaultTypeFromButtonremove type="submit" from button tagsdoRemoveEmptyAttributesremove some empty attributes (depends on "doOptimizeAttributes(true)")doRemoveValueFromEmptyInputremove 'value=""' from empty (depends on "doOptimizeAttributes(true)")doSortCssClassNamessort css-class-names, for better gzip results (depends on "doOptimizeAttributes(true)")doSortHtmlAttributessort html-attributes, for better gzip results (depends on "doOptimizeAttributes(true)")doRemoveSpacesBetweenTagsremove more (aggressive) spaces in the dom (disabled by default)doRemoveOmittedQuotesremove quotes e.g. class="lall" =&gt; class=lalldoRemoveOmittedHtmlTagsremove ommitted html tags e.g. &lt;p&gt;lall&lt;/p&gt; =&gt; &lt;p&gt;lallAll the values can be updated in the `config.php` file.

You can get detailed information from `HtmlMin` library:

##### Protected HTML

[](#protected-html)

*Inline css, inline js, conditional comments are still protected, no matter what settings you use.*

Usage
-----

[](#usage)

```
return [
    'afbora.kirby-minify-html' => [
        'enabled' => true,
        'ignore' => [
            'sitemap',
            'rss'
        ],
        'options' => [
            'doOptimizeViaHtmlDomParser'     => true,
            'doRemoveSpacesBetweenTags'      => false,
            'doMakeSameDomainsLinksRelative' => ['example.com']
        ]
    ]
];
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance58

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~180 days

Recently: every ~260 days

Total

13

Last Release

275d ago

Major Versions

1.7.1 → 2.0.02023-02-13

PHP version history (5 changes)1.0PHP ^7.1.3

1.3.0PHP ^7.3

1.4.0PHP ^7.3|^8.0

1.6.0PHP ^7.4|^8.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/78e176965f9f86b8de5a5e684e12df12a7ee15aca2848cf4394c30941c50ae7e?d=identicon)[afbora](/maintainers/afbora)

---

Top Contributors

[![afbora](https://avatars.githubusercontent.com/u/3393422?v=4)](https://github.com/afbora "afbora (22 commits)")[![grommas](https://avatars.githubusercontent.com/u/5681075?v=4)](https://github.com/grommas "grommas (1 commits)")[![nilshoerrmann](https://avatars.githubusercontent.com/u/25466?v=4)](https://github.com/nilshoerrmann "nilshoerrmann (1 commits)")

---

Tags

kirbykirby-cmskirby-pluginkirby3kirby4kirby5kirby5kirby3kirby4

### Embed Badge

![Health badge](/badges/afbora-kirby-minify-html/health.svg)

```
[![Health](https://phpackages.com/badges/afbora-kirby-minify-html/health.svg)](https://phpackages.com/packages/afbora-kirby-minify-html)
```

###  Alternatives

[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[beebmx/kirby-env

Enable env variables to Kirby

2037.9k2](/packages/beebmx-kirby-env)[afbora/kirby-loader

Plugins loader from multiple roots for Kirby

1122.3k](/packages/afbora-kirby-loader)[fabianmichael/kirby-meta

Your all-in-one powerhouse for any SEO and metadata needs imaginable.

6910.7k1](/packages/fabianmichael-kirby-meta)[wagnerwagner/merx

A toolkit to create online shops with Kirby

1152.7k](/packages/wagnerwagner-merx)[genxbe/kirby-ray

Helper tool that enables ray on all the extendable methods.

232.2k](/packages/genxbe-kirby-ray)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
