SVG "use href" tag removed when uploading SVG file

Topic summary

A user reports that when uploading SVG files to Shopify, the <use href="..."/> tag is being automatically removed from the code. They provide an example showing the original SVG file contains a <use> element referencing an internal ID (e.g., <use href="#myCircle"/>), but after upload, this tag disappears from the file.

Key Issue:

  • SVG <use> elements are stripped during the upload process
  • This breaks SVG functionality that relies on referencing defined elements

Status:

  • The user is seeking an explanation for why this occurs and potential workarounds
  • No solutions or responses have been provided yet
  • The discussion remains open with the core question unanswered
Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

When uploading SVG file, the tag get deleted from the file. Why is that and is there a workaround?

Example:

SVG file that I upload:

<svg height="661" width="1322"  xmlns="http://www.w3.org/2000/svg">
<circle id="myCircle" cx="5" cy="5" r="4" stroke="blue" />
<use href="#myCircle" x="20" fill="white" stroke="red" />
</svg>

What gets uploaded looks like this:

<svg height="661" width="1322"  xmlns="http://www.w3.org/2000/svg">
<circle id="myCircle" cx="5" cy="5" r="4" stroke="blue" />

</svg>