Clean up IDs (cleanupIds)
Shortens and deduplicates id attributes and updates url(#…) references. Essential for minifying Illustrator exports that ship long random IDs.
What Clean up IDs does in SVGO
SVGO applies cleanupIds as part of its plugin pipeline. In SVGOMG the toggle is labeled Clean up IDs (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
Almost always for production assets unless you rely on stable IDs for CSS, JS, or SMIL animation.
When to disable
SVGs with external stylesheets targeting specific IDs, or animations that reference fixed id values you cannot rename.
Watch out for
Can break fragment references if plugins run in the wrong order or IDs are referenced from outside the file.
Try it in SVGOMG
- Open svgomg.net and load your SVG (file, paste, or demo).
- Find Clean up IDs in the Features panel (
cleanupIds). - Toggle the plugin and compare the preview; download when satisfied.
SVGO Plugin Guide
Browse the SVGO Plugin Guide or read the full SVG optimization walkthrough on the homepage.