Legacy and unused code
What is unused, what looks unused but is not, and how to check before deleting or extending a file.
Read this before deleting anything, and before extending a file whose name you do not recognise.
The theme still holds code from many apps the store has removed, and from two redesigns. A file's presence in the repository does not show that the store uses it.
How to tell whether something is in use
For a section, check whether any JSON template references its type:
grep -rl '"type": *"my-section"' templates/If the section has a presets block, a merchant can still add it in the theme editor even when no template references
it. Check for one.
For a snippet, search for renders:
grep -rn "render 'my-snippet'\|include 'my-snippet'" sections snippets layout templatesTheme Check reports snippets nothing renders as OrphanedSnippet. There are currently 222 of them.
For a template, check whether any product, page or collection uses that template suffix. Only pages whose template
is set to faq in admin use page.faq.liquid, and the repository cannot show you that. Check in Shopify admin before
deleting a template.
For an entrypoint, see Entrypoints. It lists every file that no Liquid renders and says why.
Confirmed unused
Reading the code confirms these files are unused.
| File | Evidence |
|---|---|
src/entrypoints/counter.ts | Demo from the project template. No Liquid renders it and nothing imports it. It carries its own usage example in a comment |
src/components/counter/index.ts | Only counter.ts imports it |
src/entrypoints/main.ts | Contains one line, the Vite modulepreload polyfill import. Nothing renders it |
src/entrypoints/quick-add-modal.css | Appears only in the generated vite-tag.liquid. No Liquid renders it |
src/components/popup-logic/definitions/global-popup.ts | Its import in src/entrypoints/popup-logic.ts is commented out |
src/components/popup-logic/definitions/cash-vouchers.ts | Nothing imports it |
src/components/popup-logic/definitions/street-sale.ts | Nothing imports it |
The global popup matters to store staff. Its section and theme settings still appear in the theme editor, so a merchant can edit them and see no effect. See Operations: popups.
Unused settings and data
| Item | Evidence |
|---|---|
custom.max_allowed_popups metafield | Liquid writes it to window.theme.popupManagerConfig, but no script reads it |
| Global popup section and theme settings | The global-popup definition is not registered, so the storefront never shows the popup they set up |
Kept on purpose, do not delete
| File | Why |
|---|---|
src/entrypoints/mini-cart/elements/00-example.ts | A template to copy when adding a mini-cart element. The 00- prefix sorts it first |
src/entrypoints/mini-cart/internals/* | The elements import these files and no Liquid renders them. Vite emits each as its own chunk |
src/entrypoints/utils.ts | A shared module kept in the entrypoints directory for historical reasons. The booking calendar and a mini-cart rule import it |
The Australian metafield lookup in snippets/medispa-calendar-config.liquid | Hong Kong has no custom.medispa_landing_page metafield, but the lookup stays first so the two stores' code can still be merged |
App code still in the theme
These counts come from filenames. Check an app's status in Settings > Apps and sales channels before treating its code as unused, because some of these apps are still installed.
| App marker | Templates | Sections | Snippets |
|---|---|---|---|
sca (Secomapp) | 9 | 0 | 2 |
maestrooo | 6 | 0 | 0 |
discountninja (Limoni) | 2 | 0 | 11 |
limoniapps | 0 | 0 | 11 |
hulkapps | 0 | 0 | 7 |
swym | 2 | 0 | 5 |
hs- | 1 | 0 | 5 |
boost-pfs | 3 | 1 | 3 |
tolstoy | 0 | 3 | 0 |
haloroar | 1 | 0 | 0 |
yotpo | 0 | 1 | 0 |
reputon | 0 | 1 | 0 |
The maestrooo templates are the search templates from Prestige, the theme this one started from.
layouthub appears only inside the locale files, not in any filename. It causes a large share of the translation errors
described below.
The Theme Check baseline
shopify theme check currently reports 4,218 offences across 318 of 522 files, made up of 2,982 errors and 1,236
warnings. That count describes the theme as it was when these docs were written. A recent change did not cause it.
| Rule | Count | What it mostly is |
|---|---|---|
MatchingTranslations | 2,817 | Keys in fr, he, ja, ko, zh-CN and zh-TW with no entry in en.default.json, largely from the removed LayoutHub app |
VariableName | 420 | Naming style in older Liquid |
DeprecatedFilter | 236 | Liquid filters Shopify has replaced |
OrphanedSnippet | 222 | Snippets nothing renders |
UnusedAssign | 94 | Liquid assignments nothing reads |
RemoteAsset | 69 | Assets loaded from another domain |
ImgWidthAndHeight | 68 | Images without dimensions, which cause layout shift |
UndefinedObject | 59 | Liquid objects referenced but not in scope |
LiquidSyntaxError | 31 | Mostly in app snippets |
TranslationKeyExists | 24 | Duplicate keys in en.default.json |
LiquidHTMLSyntaxError | 16 | Malformed markup |
ParserBlockingScript | 13 | Scripts without defer or async |
MissingAsset | 10 | References to files not in assets/ |
ValidJSON | 1 | An invalid setting type in config/settings_schema.json |
Do not try to clear this list. Check that your change adds no offence of a type that was not already present. When you
are already editing a file, fix its ValidJSON and ImgWidthAndHeight errors.
Theme settings describes the single ValidJSON error.
Schemas that are not strict JSON
Four section schemas contain trailing commas. Shopify accepts them and Theme Check does not report them, but any tool that uses a standard JSON parser fails on them:
sections/medispa-service-callout.liquidsections/review-carousel.liquidsections/blog-posts-redesign.liquidsections/seo-content-redesign.liquid
Do not add more.
Deleting safely
- Confirm nothing references the file, using the checks at the top of this page.
- For a template, confirm in Shopify admin that no product, page or collection uses that suffix.
- Delete on a branch and push to an unpublished theme, never straight to the live theme.
- Check the affected pages on the preview.
- Put the deletion in its own commit, so you can revert it on its own.
If you delete a template that a product or page still uses, Shopify falls back to the default template. The page usually looks broken and no error appears. This is the most common way a deletion goes wrong.