Clean up IDs (cleanupIds)
Shortens and deduplicates id attributes and updates url(#…) references. Essential for minifying Illustrator exports that ship long random IDs. ID cleanup is grouped with other high-risk transforms in the Transforms that can break SVGs topic guide.
What Clean up IDs does in SVGO
SVGO applies cleanupIds as part of its plugin pipeline. On SVGOMG.net the toggle is labeled Clean up IDs (enabled by default). Optimization runs entirely in your browser — files are not uploaded to a server.
Use SVGOMG.net 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
- 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.
Part of: Transforms that can break SVGs
This plugin is covered in the Transforms that can break SVGs topic guide along with related transforms.
SVGO Plugin Guide
Browse the SVGO Plugin Guide or read the full SVG optimization walkthrough.