SVGOMG SVGO plugins

Remove doctype (removeDoctype)

Removes the <!DOCTYPE svg> declaration. Browsers do not need it for inline SVG and it only adds bytes.

What Remove doctype does in SVGO

SVGO applies removeDoctype as part of its plugin pipeline. In SVGOMG the toggle is labeled Remove doctype (enabled by default). Optimization runs entirely in your browser — files are not uploaded to a server.

Use the SVGOMG optimizer with Show original to compare before and after. If output looks wrong, disable this plugin first, then re-enable related transforms one at a time.

When to enable

Production web assets and icons where the doctype provides no behavior.

When to disable

Workflows that require a full XML document with doctype for validation.

Watch out for

None for typical browser rendering.

Try it in SVGOMG

  1. Open svgomg.net and load your SVG (file, paste, or demo).
  2. Find Remove doctype in the Features panel (removeDoctype).
  3. Toggle the plugin and compare the preview; download when satisfied.

Open SVGOMG

SVGO Plugin Guide

Browse the SVGO Plugin Guide or read the full SVG optimization walkthrough on the homepage.