Skip to content


The mkdocs-minify-plugin will minify all *.html files generated by mkdocs build in a post-processing step, stripping all unnecessary characters to reduce the payload served to the client.

Bundled with the official Docker image

This plugin is already installed for your convenience when you use the official Docker image, so the installation step can be skipped. Read the getting started guide to get up and running with Docker.


Install the plugin using pip:

pip install mkdocs-minify-plugin


Add the following lines to mkdocs.yml:

  - search # necessary for search to work
  - minify:
      minify_html: true


When enabled, all *.html will be minified automatically.