How to Create a Custom Section in Shopify
Create a custom Shopify section from scratch: the section file, its schema, example HTML and CSS, and how to add it in the theme editor — kept update-safe.
What a Shopify custom section is, every way to add one — theme editor, code, or an app — and how to keep your sections from breaking on the next theme update.
A custom section is how you shape a Shopify storefront past the layout your theme ships with — a hero, a review grid, an FAQ, a size chart, an upsell block. On an Online Store 2.0 theme, sections are the unit merchants add, reorder, and configure in the theme editor, and the unit developers reach for when a design needs something the theme does not already provide.
This is the hub for the whole topic. It explains what a section actually is, the three ways to add one and the trade-offs of each, the theme-update problem that quietly deletes a lot of hand-built work, and where to go next for the specific task you are trying to do.
A section is a reusable, self-contained block of a page. Technically, it is a
.liquid file in your theme's sections/ folder that pairs markup (Liquid and
HTML) with a {% schema %} block. The schema is a small piece of JSON that
declares the section's name and its editable settings — text fields, image
pickers, color swatches, and so on.
That schema is what makes a section feel like a first-class part of Shopify. Once a section exists in the theme, it shows up in the theme editor's "Add section" menu. A merchant can drop it onto a template, fill in its settings, reorder it, and hide it — all without touching code. Sections can also contain blocks: smaller repeatable items (a single slide, one FAQ row, one testimonial) that a merchant adds and reorders inside the section.
A few related terms are worth separating early:
templates/product.json, templates/index.json)
that lists which sections appear on that page, and in what order.There are three practical routes to a new section, and they differ mostly in how much control you get versus how much can break later.
Many themes already include flexible sections — often a "Custom Liquid", "Multicolumn", "Rich text", or "Image with text" section. You add one from the editor, configure its settings, and you are done. This is the fastest path and needs no development, but you are limited to what the theme's built-in sections expose. For a genuinely new layout, the settings usually will not stretch far enough.
For full control you write the section yourself: a new .liquid file in
sections/, with your markup and a {% schema %} that defines exactly the
settings you want. This is the most flexible route and the one most tutorials
teach. The step-by-step is here:
How to create a custom section in Shopify.
The catch is ownership: the file now lives inside your theme. That is fine until you update or replace the theme — which is the problem covered below.
A section can also be delivered by a Shopify app as an app block or an app-embedded section, rendered through a Theme App Extension. You install the app, and its sections appear in the editor next to the theme's own. Because the markup lives in the app — not in your theme files — it is not touched when the theme is updated. This is the mechanism SectionGuard uses, and it is explained in depth in Shopify Theme App Extensions, explained.
Here is the issue that decides whether your work survives. When you add a section
by editing theme files — a new .liquid file, or pasted markup inside a "Custom
Liquid" box — that code becomes part of that specific theme version. Shopify does
not merge your edits into a theme update. When you install a new version of the
theme (or switch themes entirely), the update publishes a fresh copy of the
theme's files, and anything you added by hand to the old copy is not carried over.
In practice that means a store owner can spend hours building a custom section, update the theme months later to get a bug fix or a new feature, and find the section gone. Section settings a merchant configured in the editor are stored per template, so those can be lost too if the section they referred to no longer exists.
There are two honest ways to avoid this:
Neither route is "correct" in the abstract. A one-off tweak on a theme you rarely touch is fine to hand-code. A section you rely on across theme changes is safer rendered from an app. The honest comparison lays out which survives a theme update and which survives an app uninstall, so you can choose with open eyes.
The cluster guides below cover each task step by step. Start with the one that matches what you are doing:
If your real question is "how do I keep these sections when I change themes", read Theme App Extensions alongside the comparison — together they explain why app-rendered sections survive updates that overwrite theme files, and where SectionGuard fits.
Step-by-step how-tos and explainers in this topic.
Create a custom Shopify section from scratch: the section file, its schema, example HTML and CSS, and how to add it in the theme editor — kept update-safe.
Add a section to any Shopify page from the theme editor: pick the template, insert and reorder the section, configure it, and reuse it across pages.
Add a custom section to your Shopify homepage from the theme editor, order it around the hero, and configure it — plus how to keep it on a theme update.
Add a section to the Shopify product page: the product template, app blocks in the product form, reading product data and metafields, and update-safety.
Add custom HTML to a Shopify page: the built-in Custom Liquid section, a reusable HTML section with a schema, escaping pitfalls, and update-safety.
Three ways to style a Shopify section — a {% stylesheet %} block, an assets file, and theme color settings — scoped so it never leaks into the rest of the theme.
How to use the Custom Liquid section, add a script tag, and run JavaScript in a Shopify section without breaking the theme, leaking scope, or slowing the page.
A reference for the Shopify section schema: settings, blocks, presets, and limits — with the exact JSON and how each field maps to the theme editor.
Add a product review section on Shopify — with a built-in reviews app, a metafield-driven Liquid section, or a review app block — kept update-safe.
Add an FAQ section on Shopify with a collapsible accordion — built from section blocks so merchants add and reorder questions, plus valid FAQ schema.
Add an order notes field at checkout, a delivery-notes box on the cart, or a note-taking section on a page in Shopify — with the right method for each.
Add an upsell or cross-sell section to a Shopify product page — from product-recommendations, hand-picked products, or an app block — with real section code.
SectionGuard renders your custom sections through a Theme App Extension — your theme stays clean and fully updatable.
Free for up to 3 sections · No credit card · Works on OS 2.0 & Horizon.