Skip to main content

OrphanedSnippet

Identifies snippets that exist but are never referenced in the theme.


The following examples contain code snippets that either fail or pass this check.

This snippet exists but is never referenced.

snippets/unused-snippet.liquid

<div class="orphaned-content">
This content will never be displayed
</div>

This snippet is properly referenced somewhere in the theme.

snippets/used-snippet.liquid

<div class="active-content">
This content is used
</div>

templates/index.liquid

{% render 'used-snippet' %}

The following example contains the default configuration for this check:

OrphanedSnippet:
enabled: true
severity: warning
ParameterDescription
enabledWhether this check is enabled.
severityThe severity of the check.

Anchor to Disabling this checkDisabling this check

This check is safe to disable.


Was this page helpful?