File-Based vs. App-Based Shopify Sections

The core difference between file-based and app-based Shopify sections: which survives a theme update, which survives an uninstall, and how each renders.

4 min readUpdated

Part of our Section Store Alternative — the Honest Comparison.

Every Shopify section reaches the storefront one of two ways: its code lives in your theme files, or it renders from an app. That single distinction — file-based vs. app-based — explains most of what people find confusing about sections, especially why some vanish after a theme update and others survive it. This is the explainer the other comparisons on this hub build on, so it is worth understanding before you choose an app or hand-write a section yourself.

Neither approach is "the right one." They trade off in opposite directions, and the correct choice depends on how your store operates. The goal here is to make the mechanism obvious so the trade-off is a decision, not a surprise.

File-based sections: the code is in your theme

A file-based section is a .liquid file in your theme's sections/ folder. It does not matter whether you wrote it by hand or a section-library app copied it in — once it is there, it is part of your theme code. It pairs markup with a {% schema %} block, and that schema is what makes it appear and be configurable in the theme editor:

<section class="promo-banner">
  <h2>{{ section.settings.heading }}</h2>
  <p>{{ section.settings.body }}</p>
</section>

{% schema %}
{
  "name": "Promo banner",
  "settings": [
    { "type": "text", "id": "heading", "label": "Heading" },
    { "type": "richtext", "id": "body", "label": "Body" }
  ],
  "presets": [{ "name": "Promo banner" }]
}
{% endschema %}

Because the file is in your theme, the section keeps working even if you uninstall the app that added it — there is no ongoing dependency. The step-by-step for building one is in how to create a custom section.

The catch is what happens on a theme update. When you install a new version of the theme or switch themes, Shopify publishes a fresh copy of the theme's files. It does not merge your additions into that copy — so a section you (or a file-based app) added to the previous version is not carried over, and any settings merchants configured for it can be lost too. This is standard Shopify behavior, covered in does a theme update delete your customizations.

App-based sections: the code is in the app

An app-based section renders through a Theme App Extension. The section's markup lives in the app; your theme holds only a small reference that tells Shopify to render the app's block at that spot on the page. In the theme editor it shows up as an app block or app-embedded section, right next to the theme's own sections, and merchants configure it the same way.

Because the markup is not a file in your theme, a theme update or theme swap does not touch it. Shopify is only replacing theme files, and the section is not one of them — so it renders identically before and after the update, with the same settings. That is the property that makes app-based sections durable across theme changes.

The trade-off is the mirror image of the file-based one: the section renders while the app is installed. Uninstall the app and the app-based section stops rendering, because the code it needs lives in the app you just removed.

The trade-off, side by side

File-basedApp-based
Where the code livesYour theme's sections/ folderThe app (Theme App Extension)
Appears in the theme editorYesYes (as an app block)
Survives an app uninstallYesNo
Survives a theme update / swapNot reliablyYes
Ongoing dependencyNone after installThe app must stay installed
Best forOne-off blocks on a stable themeSections you rely on across theme changes

How to choose

  • Pick file-based when the section is a one-off on a theme you rarely change, or when you specifically want zero ongoing app dependency. Keep a list of every section you added so you can re-apply it after a theme update. The workflow is in update your theme without losing customizations.
  • Pick app-based when you update or redesign your theme regularly, run more than one theme, or the section is load-bearing enough that losing it to a routine update is not acceptable.

Many stores end up doing both: a file-based library for disposable blocks, and an app-based approach for the sections that must persist.

Where SectionGuard fits

SectionGuard is the app-based approach applied to your own custom sections: they render from the app through a Theme App Extension instead of being copied into your theme, so a theme update or swap does not wipe them, and merchants configure them in the standard theme editor. The honest limitation is the app-based one above — the sections render while the app is installed.

If durability across theme updates is what you are after, that is exactly the property this model gives you — see what SectionGuard does, and compare it against a specific library in the Section Store alternative breakdown.