Minify HTML


Ever look at the HTML markup of your website and notice how sloppy and amateurish it looks? The Minify HTML plugin cleans up sloppy looking markup and minifies, which also speeds up download time.

Make your website’s markup look professional by using Minify HTML. Easy to use, simply install and activate (with additional options for advanced settings).

Minify HTML also has optional specialized minification for JavaScript and internal CSS. It doesn’t mess with your textareas or preformatted text.

Settings options to removes HTML, CSS and JavaScript comments (leaving MSIE conditional comments), remove unneeded XHTML closing tags from HTML5 void elements and remove unneeded relative schemes and domains from links.


  • Minify HTML settings.
  • Minify HTML turns this...
  • To this!


For an automatic installation through WordPress:

  1. Select Add New from the WordPress Plugins menu in the admin area.
  2. Search for Minify HTML.
  3. Click Install Now, then Activate Plugin.

For manual installation via FTP:

  1. Upload the minify-html-markup folder to the /wp-content/plugins/ directory.
  2. Activate the plugin from the Plugins screen in your WordPress admin area.

To upload the plugin through WordPress, instead of FTP:

  1. From the Add New plugins page in your WordPress admin area, select the Upload Plugin button.
  2. Select the file, click Install Now and Activate Plugin.


Are there any settings for Minify HTML?

Yes. Under the Settings menu in the admin console there’s a Minify HTML menu item which allows you to modify Minify HTML settings.

Hoe werkt het?

Magic, obviously! Actually, it creates an output buffer and then preforms its ‘magic’ on the output buffer. It kinda is like magic.

Will it break my stuff?

Normally, you won’t notice any changes to the way the site looks in the browser. However, if you rely on white space between HTML tags (which you shouldn’t be doing) you may notice very isolated elements with reduced horizontal spacing. This is because inline objects will add a few pixels of spacing if there’s whitespace between the objects. I consider Minify HTML a good way of finding these style ‘errors’ and correcting them with proper padding or margin style.

Is it fast?

Plenty. On my server that’s running dozens of websites, it takes 0.007 seconds to minify a page. Also, because the HTML file is smaller, it will speed up transfer and rendering times. Minify HTML doesn’t use bloated external libraries that add additional overhead and therefore take longer to process.

How much smaller will my HTML be?

With real-world test sites, the HTML file is around 20-25% smaller. Even when using deflate/gzip compression the resulting file is around 20% smaller, speeding up download times.

I’m using deflate/gzip to compress HTML, do I need Minify HTML?

With Minify HTML, the source HTML file will be smaller, therefore, it will compress faster and be even smaller once compressed. Also, even with deflate/gzip, your HTML markup will still look sloppy and amateurish. Minify HTML corrects this even for deflated/gzip transfers (and also saves another 20% in bandwidth).


27 november 2021
It is on 10 sites, accelerated by 10-15%. So I definitely recommend to install. I haven't broken a single site. I use: Gutenberg, Elementor and WP page Builder. I hope for constant updates of the plugin and thank you for the developer's work.
31 oktober 2020
Just try this plugin specially if you are using a page caching plugin that does not support HTML minification or enable that breaks the layout. I have not faced any issues with this plugin so far. And yes, it works with the latest WP version, so you don't have to worry about that.
29 augustus 2018
UM EXCELENTE PRODUTO! Grande plugin ele faz o que promete e funciona perfeitamente!!!! Parabéns!
23 april 2018
I love a plugin that works out of the box. I'm using a multisite installation and Minify HTML works perfectly.
Lees alle 22 beoordelingen

Bijdragers & ontwikkelaars

“Minify HTML” is open source software. De volgende personen hebben bijgedragen aan deze plugin.


Vertaal “Minify HTML” naar jouw taal.

Interesse in ontwikkeling?

Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.


v2.00 – 2/1/2021

  • Updated contact email address, verified working with WordPress v5.6

v1.99 – 05/21/2018

  • Compatiblity with WordPress thru 4.9.6
  • Text changes

v1.98 – 03/15/2017

  • Forces the multi-byte UTF-8 encoding option to default to OFF
  • Added support for WP-CLI (command line interface for WordPress)

v1.97 – 03/06/2017

  • Added option to support multi-byte UTF-8 encoding if your foreign language website introduces odd characters.

v1.96 – 03/02/2017

  • Removed multi-byte non-English encoded content support because it caused problems with many English sites. Will make this an option instead in a future release.

v1.95 – 03/02/2017

  • Correctly deals with multi-byte UTF-8 encoded content (typically non-English language websites).

v1.94 – 01/03/2017

  • Added option to not minify JavaScript.

v1.93 – 12/28/2016

  • Removed extra blank lines after v1.92 modification.

v1.92 – 12/27/2016

  • Corrected rare problem with inline JavaScript line comments.

v1.91 – 6/29/2016

  • Fixed a problem with errors in the log and the “Remove schemes” switch not quite working correctly.

v1.9 – 5/10/2016

  • Broke up option to remove relative schemes and domains into two options.
  • Cleaned up settings page, gives option suggestions.

v1.8 – 5/10/2016

  • New Minify HTML Settings menu item in the admin console.
  • Option to deactivate Minify HTML without
  • Option to remove HTML, JavaScript and CSS comments.
  • Option to remove XHTML closing tags from HTML5 void elements.
  • Option to remove relative schemes and domains from links.

v1.7 – 4/21/2016

  • Now removes CSS and JavaScript comments.
  • Fixed issue with minification of internal CSS media queries.
  • Fixed issue with Google AMP reporting problems with the style boilerplate.
  • No longer minifies XML files (which Minify HTML was never designed to do).

v1.6 – 3/1/2016

  • Removes HTML comments to further reduce file size (doesn’t remove MSIE conditional comments).

v1.5 – 2/23/2016

  • No longer minifies the admin dashboard.
  • Some additional JavaScript minification.

v1.4 – 2/23/2016

  • Fixed bug that could cause ‘M1N1FY-ST4RT’ to output to website.

v1.3 – 2/22/2016

  • Added compatibility for PHP 7.0.0

v1.2 – 2/22/2016

  • Compatible with older versions of PHP.
  • More effective at cleaning up tabs, JavaScript, and internal CSS.
  • Cleaned up source code and made a few performance tweaks.

v1.1 – 2/19/2016

  • Also minifies internal CSS.

v1.0 – 2/18/2016

  • Eerste release.