How to svg metadata: types, sources, and what to remove
- Step 1Identify the metadata types present — Open the SVG source and tag what you see:
<metadata>(RDF),<title>/<desc>(accessibility), editor namespaces (xmlns:inkscapeetc.), root attributes (version/id/xml:space/data-*), the<?xml?>declaration, and comments. - Step 2Decide keep vs remove per type — Editor namespaces and
<metadata>author records: remove for public assets. Accessibility<title>/<desc>: keep if the icon is meaningful (or re-add the name in HTML after removal).viewBox/width/height: always keep — they are not metadata. - Step 3Run the scrubber for element + attribute metadata — The Metadata Scrubber removes all
<metadata>/<title>/<desc>elements and the root editor namespaces andversion/id/xml:space/data-*/inkscape:/sodipodi:attributes — in one pass, no options. - Step 4Run the minifier for comments and the prolog — The scrubber does not remove comments or
<?xml?>. Run the SVG Pro Minifier to drop the generator comment, the XML declaration, inter-tag whitespace, empty attributes, and redundant namespaces. - Step 5Handle leftovers — Nested editor attributes (
inkscape:labelon a<g>) and orphaned definitions are separate concerns. The minifier helps with redundant namespaces; the SVG Unused Defs Purger removes unreferenced gradients/clipPaths/symbols. - Step 6Re-supply accessibility if needed — If you removed a meaningful
<title>, add an accessible name at the usage site (aria-labelon the<svg>or container), or mark decorative iconsaria-hidden="true". Removal plus an HTML-level name is the cleanest pattern.
SVG metadata types reference
Every common metadata type, its source, the privacy/size impact, and the JAD tool that removes it.
| Type | Where it comes from | Keep or remove? | Removed by |
|---|---|---|---|
<metadata> (RDF / Dublin-Core) | Inkscape, Illustrator (author/title/date/licence) | Remove (privacy) | Metadata Scrubber |
<title> (accessibility) | Figma layer name, hand-authored a11y name | Keep if meaningful, else remove + re-add in HTML | Metadata Scrubber (removes all) |
<desc> (accessibility/notes) | Editor notes, attribution text | Usually remove | Metadata Scrubber (removes all) |
xmlns:inkscape / sodipodi / dc / cc / rdf | Inkscape; Illustrator (dc/cc/rdf) | Remove (fingerprint, breaks SVGO) | Metadata Scrubber (root) + Minifier |
Root version / id / xml:space | Illustrator export defaults | Remove | Metadata Scrubber |
Root data-* / inkscape: / sodipodi: attrs | Editors, design plugins | Remove | Metadata Scrubber (root only) |
Nested inkscape:label etc. (child elements) | Inkscape layers | Remove | Minifier / manual (NOT the scrubber) |
<!-- Generator: … --> comment | Illustrator, Sketch | Remove (fingerprint) | Minifier (NOT the scrubber) |
<?xml … ?> declaration | Illustrator and others | Remove for inline use | Minifier (NOT the scrubber) |
viewBox / width / height / fill | Required rendering attributes | Keep always | None — never removed |
Coverage: scrubber vs minifier
Side-by-side of what each of the two cleanup tools is responsible for, so you know which to run.
| Metadata | Metadata Scrubber | SVG Pro Minifier |
|---|---|---|
<metadata> / <title> / <desc> elements | Removes all | Not its job |
| Root editor namespaces + version/id/xml:space | Removes | Removes editor namespaces too |
| XML comments (generator line) | Leaves | Removes |
<?xml?> declaration | Leaves | Removes |
| Inter-tag whitespace / empty attributes | Leaves | Removes |
| Nested child editor attributes | Leaves | Helps via redundant-namespace removal |
Cookbook
Each metadata type in isolation, with the exact source fragment and the tool that clears it — so you can match what you see in your file to the right action.
RDF metadata block
The <metadata> element holds the Dublin-Core record. The scrubber removes the whole element, taking author, title, date, and licence with it.
<metadata>
<rdf:RDF><cc:Work>
<dc:format>image/svg+xml</dc:format>
<dc:creator><cc:Agent><dc:title>A. Designer</dc:title></cc:Agent></dc:creator>
</cc:Work></rdf:RDF>
</metadata>
Removed by: Metadata Scrubber (entire element).Accessibility title and desc
These are the a11y elements. The scrubber removes both unconditionally — keep this in mind for meaningful icons.
<title>Download file</title> <desc>An arrow pointing into a tray</desc> Removed by: Metadata Scrubber (all <title>/<desc>). If the icon is meaningful, re-add aria-label in HTML afterward.
Editor namespaces and root attributes
The fingerprint payload. Root namespaces and version/id/xml:space are removed by the scrubber.
<svg xmlns:dc="..." xmlns:rdf="..." xmlns:inkscape="..."
version="1.1" id="svg5" xml:space="preserve"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
After scrubber:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">The comment + prolog the scrubber leaves
Comments and the XML declaration are not elements, so the scrubber leaves them. The minifier removes both — this is the single most common reference question.
<?xml version="1.0" encoding="UTF-8"?> <!-- Generator: Adobe Illustrator 28.0 --> <svg …>…</svg> Scrubber: leaves both lines. Minifier (/svg-tools/svg-pro-minifier): removes both.
Nested editor attribute that survives
Editor attributes on child elements are out of the scrubber's root-only attribute pass. They need the minifier or manual removal.
<g inkscape:label="Layer 1" inkscape:groupmode="layer"> <path d="M2 2h20v20H2z"/> </g> Scrubber: leaves inkscape:label / inkscape:groupmode (nested). Minifier: removes the redundant xmlns:inkscape declaration; clear the prefixed attrs there or by hand.
Edge cases and what actually happens
Expecting the scrubber to remove the generator comment
By designComments are comment nodes, not elements or attributes, and the scrubber removes only elements (<metadata>/<title>/<desc>) and attributes. The Illustrator generator comment is left. Use the SVG Pro Minifier for comments and the <?xml?> prolog.
Nested `inkscape:label` survives a scrub
PartialThe attribute pass iterates the root <svg> only, so editor attributes on child <g>/<path> elements remain. After the root xmlns:inkscape declaration is removed, these are orphaned prefixed attributes. The minifier's redundant-namespace removal helps; otherwise remove them manually.
Removing `<title>` breaks an accessible icon
Trade-offThe scrubber removes all <title>, including legitimate accessibility names. For meaningful icons, re-supply the name with aria-label in HTML, or keep a controlled <title> in your component template. Decorative icons should be aria-hidden="true".
`<desc>` holding licence/attribution text
RemovedAttribution text stored in <desc> is removed with all other <desc>. If your licence requires in-file attribution, keep an unscrubbed master or move attribution outside the SVG. The scrubber does not distinguish licence text from editor notes.
Treating `viewBox` or `width` as metadata
PreservedviewBox, width, height, fill, class, and style are rendering/layout attributes, not metadata, and are never removed. If they are causing problems (e.g. a missing viewBox), that is a job for the SVG ViewBox Fixer, not a metadata tool.
Unused `<defs>` mistaken for metadata
Different toolOrphaned gradients, filters, clipPaths, and symbols in <defs> are dead rendering code, not metadata, and the scrubber does not remove them. The SVG Unused Defs Purger handles those.
RDF block split across namespaces
Removed (whole element)Even a complex <metadata> with rdf:, dc:, and cc: children is removed as a single element — the scrubber deletes the <metadata> node and everything inside it, so the namespace complexity does not matter.
Comment inside `<style>` or `<script>`
PreservedComments within embedded <style> or <script> are not metadata and are left untouched (and the minifier's comment removal targets XML <!-- --> comments, not CSS/JS comments). Review embedded code separately if it contains sensitive content.
Already-minimal SVG with no metadata
No-opIf none of the listed metadata types are present, the scrubber returns the file essentially unchanged. That is correct — there is nothing to remove. The size 'saving' may read as 0%.
Frequently asked questions
What counts as 'metadata' in an SVG?
Several distinct things: the <metadata> element (usually an RDF/Dublin-Core record), the <title> and <desc> accessibility elements, editor namespace declarations and their prefixed attributes, root housekeeping attributes (version/id/xml:space/data-*), the <?xml?> declaration, and XML comments. They are removed by different mechanisms, which is why one tool does not clear all of them.
Which metadata does the JAD scrubber remove?
All <metadata>, <title>, and <desc> elements; the root xmlns:dc/cc/rdf/svg/sodipodi/inkscape declarations; the root version, id, xml:space attributes; and root-level data-*, inkscape:, sodipodi: attributes. It does not remove comments, the <?xml?> prolog, or editor attributes on nested child elements.
How do I remove the generator comment and XML declaration?
With the SVG Pro Minifier. The scrubber leaves comments and the prolog because it operates on elements and attributes, not comment or processing-instruction nodes. Run scrub then minify for a fully clean file.
Is `<title>` safe to remove?
Only if the icon is decorative. <title> provides the accessible name for meaningful icons. The scrubber removes all <title>, so for meaningful icons re-add the name via aria-label in HTML or a controlled <title> in your component, and mark decorative icons aria-hidden="true".
Which namespaces are editor-specific vs functional?
xmlns:inkscape, xmlns:sodipodi, xmlns:dc, xmlns:cc, and xmlns:rdf are editor/metadata namespaces and safe to remove. The default xmlns="http://www.w3.org/2000/svg" is required, and xmlns:xlink is functional if any xlink: attribute is used. The scrubber removes the editor ones and preserves the SVG default.
Does removing metadata change how the SVG renders?
No. None of the removed types affect rendering. Path data, colours, viewBox, and layout attributes are preserved, so the artwork is identical. Metadata is, by definition, the non-rendering part of the file.
What about editor attributes on layers, like `inkscape:label`?
Those live on nested child elements, which the scrubber's root-only attribute pass does not iterate, so they survive. The SVG Pro Minifier removes the redundant namespace declaration that makes them valid; clear the prefixed attributes there or manually if your linter flags them.
Are unused gradients or clipPaths considered metadata?
No — they are dead rendering definitions, not metadata, and the scrubber leaves them. Use the SVG Unused Defs Purger to remove unreferenced <defs> children.
Does the scrubber touch CSS variables or class names?
No. class, style, and CSS custom properties are rendering/styling, not metadata, and are preserved. If you want to extract colours into CSS variables, that is the SVG CSS Variable Injector, a separate tool.
Will EXIF in an embedded image be removed?
No. EXIF lives inside an embedded raster (<image> base64), not in SVG metadata, and the scrubber does not decode raster bytes. Strip EXIF from the image before embedding it.
Can I run the scrubber repeatedly without harm?
Yes. It is idempotent — a second pass finds no metadata elements or editor attributes to remove and returns the file unchanged. Safe to include in every build.
What is the complete clean-up order for a public SVG?
Scrub structural metadata with the Metadata Scrubber, remove comments and the prolog with the SVG Pro Minifier, then optionally cut size with the SVG Precision Tuner and SVG Unused Defs Purger.
Privacy first
Every JAD SVG tool runs entirely in your browser using the DOM API and Canvas. Your SVG files never leave your device — verified by zero outbound network requests during processing.