Title: &#8220;Staatic&#8221; &amp; minify html code
Last modified: May 7, 2023

---

# “Staatic” & minify html code

 *  Resolved [angelseee](https://wordpress.org/support/users/angelseee/)
 * (@angelseee)
 * [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/)
 * My site uses minify html code:
 *     ```wp-block-code
       <p>Example-1</p><p>Example-2</p><p>Example-3</p>
       ```
   
 * Your plugin invalidates minify html code:
 *     ```wp-block-code
       <p>Example-1</p>
       <p>Example-2</p>
       <p>Example-3</p>
       ```
   
 * How to make “Staatic” save minify html code?

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

 *  Plugin Author [Team Staatic](https://wordpress.org/support/users/staatic/)
 * (@staatic)
 * [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/#post-16719984)
 * Unfortunately Staatic is unable to retain the minified HTML code completely, 
   since it alters the HTML code during the rewriting of URLs.
 * However, you may have better results while using “Simple Html Dom Parser”, which
   can be configured in Staatic > Settings > Advanced. From our experience, this
   HTML DOM Parser leaves unchanged HTML mostly as-is.
 * To ensure fully minified HTML code, the minification process should be applied
   after all pages have been processed by Staatic.
 * Note that some CDN services have built in HTML (and CSS/JS) minification available,
   like Cloudflare and Netlify, which could make this very easy if available to 
   you.
 *  Thread Starter [angelseee](https://wordpress.org/support/users/angelseee/)
 * (@angelseee)
 * [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/#post-16720006)
 * Thanks for the answer! Unfortunately, “Simple Html Dom Parser” keeps minification,
   but not completely 🙁
 *  Plugin Author [Team Staatic](https://wordpress.org/support/users/staatic/)
 * (@staatic)
 * [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/#post-16723011)
 * We have created an [example HTML minification plugin](https://assets.staatic.com/support/staatic-html-minifier-example.zip)
   which uses voku [HtmlMin](https://github.com/voku/HtmlMin) under the hood, in
   order to minify any HTML resources processed by Staatic during the publication
   process. Feel free to modify the plugin as needed.
 *  Thread Starter [angelseee](https://wordpress.org/support/users/angelseee/)
 * (@angelseee)
 * [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/#post-16723304)
 * Thank you very much for your new wonderful plugin **“Staatic HTML Minifier”**!
   It perfectly complements the magical work of your main plugin **“Staatic – Static
   Site Generator”**!
 *  Thread Starter [angelseee](https://wordpress.org/support/users/angelseee/)
 * (@angelseee)
 * [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/#post-16723461)
 * Plugin **“Staatic HTML Minifier”** does not put these tags at the end of the 
   html code of a static page:
 *     ```wp-block-code
       </body></html>
       ```
   
 * Please, fix this bug!
 *  Plugin Author [Team Staatic](https://wordpress.org/support/users/staatic/)
 * (@staatic)
 * [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/#post-16725081)
 * >  Plugin **“Staatic HTML Minifier”** does not put these tags at the end of the
   > html code of a static page:
   > `</body></html>`
 * This is by design, since these tags are optional in HTML5. See also: [https://html.spec.whatwg.org/multipage/syntax.html#syntax-tag-omission](https://html.spec.whatwg.org/multipage/syntax.html#syntax-tag-omission).

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

The topic ‘“Staatic” & minify html code’ is closed to new replies.

 * ![](https://ps.w.org/staatic/assets/icon.svg?rev=2550278)
 * [Staatic - Static Site Generator](https://wordpress.org/plugins/staatic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/staatic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/staatic/)
 * [Active Topics](https://wordpress.org/support/plugin/staatic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/staatic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/staatic/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Team Staatic](https://wordpress.org/support/users/staatic/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/staatic-minify-html-code/#post-16725081)
 * Status: resolved