Title: Prevent HTML minification/optimization
Last modified: June 27, 2025

---

# Prevent HTML minification/optimization

 *  Resolved [markus35425](https://wordpress.org/support/users/markus35425/)
 * (@markus35425)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/prevent-html-minification-optimization/)
 * Hi. We would love to use simply static and it’s almost working for us. But:
 * Our wordpress pages contain HTML that will be re-hydrated by Javascript (a Svelte
   app).
   When running simply static, it unfortunately changes the HTML slightly (
   e.g. removing empty style attributes, formatting). When the JS app starts, it
   tries to re-use (re-hydrate) the HTML it previously generated, but fails due 
   to the static export changes. Example:
 *     ```wp-block-code
       <div style="">
       ```
   
 * is turned into just
 *     ```wp-block-code
       <div>
       ```
   
 * This is of course okay if you want to minify HTML. But if a JS app expects to
   find the HTML as it has generated it, it causes a problem.
   Is there a way to 
   disable such optimizations or mark a section of HTML code as DO-NOT-TOUCH?If 
   not, could be implemented (e.g. as a payed feature)?
 * Kind regards, Markus
    -  This topic was modified 11 months, 2 weeks ago by [markus35425](https://wordpress.org/support/users/markus35425/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [patrickposner](https://wordpress.org/support/users/patrickposner/)
 * (@patrickposner)
 * [11 months, 1 week ago](https://wordpress.org/support/topic/prevent-html-minification-optimization/#post-18541210)
 * Hey [@markus35425](https://wordpress.org/support/users/markus35425/),
 * thanks for reaching out!
 * That is indeed a problem that happens now and then and is caused by the package
   we are using behind the scenes: [https://github.com/voku/simple_html_dom](https://github.com/voku/simple_html_dom)
 * It’s not optimization, but rather a W3C validity check – the crawler essentially
   attempts to auto-fix invalid HTML (such as empty attributes) without a way to
   stop it.
 * However, we are working on a replacement that is based on the new [WordPress HTML API](https://developer.wordpress.org/news/2023/09/the-html-api-process-your-tags-not-your-pain/).
   
   We even have a fully functional branch in our GitHub repository already: [https://github.com/Simply-Static/simply-static/tree/html-api](https://github.com/Simply-Static/simply-static/tree/html-api)
 * If you’d like, you can reach out to [support@simplystatic.com](https://wordpress.org/support/topic/prevent-html-minification-optimization/support@simplystatic.com?output_format=md),
   and we’ll work together to resolve the issue. We can send you a fully built release
   file for testing and adapt the integration as needed.

Viewing 1 replies (of 1 total)

The topic ‘Prevent HTML minification/optimization’ is closed to new replies.

 * ![](https://ps.w.org/simply-static/assets/icon-256x256.png?rev=2443263)
 * [Simply Static - The Static Site Generator](https://wordpress.org/plugins/simply-static/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simply-static/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simply-static/)
 * [Active Topics](https://wordpress.org/support/plugin/simply-static/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simply-static/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simply-static/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [patrickposner](https://wordpress.org/support/users/patrickposner/)
 * Last activity: [11 months, 1 week ago](https://wordpress.org/support/topic/prevent-html-minification-optimization/#post-18541210)
 * Status: resolved