Minify HTML: Site Booster Module

Minify HTML module enables you to apply HTML minification on your website pages (page source), which optimizes your page's loading time. Additional features to tailor the minifcation process specific to your needs also available.

Minify HTML feature is available as of Site Booster 1.2.0 version, and above.

To enable Minify HTML features, toggle to enable the module, then toggle the main Minify HTML option.

Enable (or disable) any option you would like to use, then save changes at the bottom of the module page.

Available Minify HTML options include:

Minify HTML

Minify HTML allows you to automatically remove whitespace, line breaks, and comments from generated HTML before sending to users.

Your pages’ HTML output is more compact - fewer bytes transferred, slightly faster load times. All functionality remains unchanged.

Compact Inline Scripts

Compact Inline Scripts option allows you to minify any inline <script> blocks (e.g., JavaScript embedded directly in HTML) by removing unnecessary whitespace.

Inline JavaScript becomes a single line without extra spaces. This reduces overall page size without impacting behavior.

Eliminate Comments

Eliminate Comments option allows you to remove HTML comments (<!-- comment -->) from the final output to reduce payload size.

Any developer comments or notes inside your templates are stripped out of the delivered HTML, resulting in a leaner page.

Simplify Void Element Tags

Simplify Void Element Tags option allows you to automatically convert tags like <img /> or <br /> to <img> or <br> (HTML5 style), removing unnecessary self-closing slashes.

HTML is marginally smaller, and you adhere strictly to HTML5 conventions, which can improve compatibility with some parsers.

Shorten Internal URLs

Shorten Internal URLs option allows you to automatically rewrite internal links to drop redundant parts, such as removing your domain name from all internal links inside the page's HTML source.

It's generally safe to use this feature, but ensure to test your site properly if applied.

Omit URL Protocols

Omit URL Protocols option allows you to remove the http:// or https:// protocol from URLs in attributes (e.g., src, href), making them protocol-relative (e.g., //example.com/style.css).

Resources use protocol-relative URLs. If your site switches from HTTP to HTTPS, browsers automatically pick the correct protocol without mixed-content warnings.

However, we don't recommend using this feature unless you really have to for whatever reason, like a broken CSS certificate.

Enable UTF-8 Compatibility

Enable UTF-8 Compatibility option allows you to enforce HTML <meta charset="UTF-8"> tag, and ensure it's present and properly declared, guaranteeing consistent character encoding.

Browsers consistently render all characters (accents, symbols) correctly. This prevents “weird character” issues on multilingual sites.


Found an error in this doc or believe it needs improvement?

Send us a prepurchase ticket, include the URL of the page, and add suggestions and more details about how we can make things better for you.

That's it!

Boost your WordPress website on all levels with OceanWP and Ocean Site Booster.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.