How to Add a Custom Template in Shopify (2026)

Last updated
•
Expert reviewed
•
5 min read

Key takeaways

  • Custom templates let you give specific pages, products, or collections a completely different layout.
  • Create them in the Theme Editor (template dropdown → Create template) or in the code editor: templates folder → new file (e.g., page.custom.json or product.feature.json).
  • JSON templates define which sections appear on the page — no HTML required.
  • Assign a template to a page, product, or collection via the “Theme template” dropdown in the editor.

To add a custom template in Shopify, open the Theme Editor, pick the page type from the template dropdown at the top and click Create template. For full control, add a new JSON file to the templates/ folder in the code editor. Either way, specific pages, products or collections get their own layout without a separate theme.

How do I create a custom template in Shopify?

Custom templates live in the templates/ folder of your theme. Each template is a JSON file that defines which sections appear on that page type.

Naming convention:

  • page.custom.json — a custom page template (accessible as “page.custom” in the template selector)
  • product.feature.json — a custom product template
  • collection.seasonal.json — a custom collection template
  • article.long-form.json — a custom blog post template

The part before the dot is the page type. The part after is your custom name. Name the custom part in lowercase, with hyphens instead of spaces.

For the page itself, see Create a New Page in Shopify.


Create a template in the Theme Editor (no code)

Every Online Store 2.0 theme can create a template without the code editor.

Step 1 - Go to Online Store → Themes → Customize.

Step 2 - Open the template dropdown at the top of the editor and choose the page type (for example, Pages or Products).

Step 3 - Click Create template, give it a name, and choose the existing template it should be based on.

Step 4 - Add, remove and reorder sections, then save. Shopify writes the JSON file for you.


Create a template in the code editor

Step 1 - Duplicate your theme. Online Store → Themes → three-dot menu → Duplicate.

Step 2 - Open the code editor on the duplicate theme. Go to Online Store → Themes, click the three-dot menu (…) next to the duplicate theme, then Edit code.

Step 3 - Navigate to the templates/ folder.

Step 4 - Click “Add a new template” (the + button next to the folder, or look for an “Add template” option).

Step 5 - Select the template type (page, product, collection, etc.) and give it a name (e.g., “landing”).

Step 6 - Shopify creates a new JSON file: page.landing.json.

Step 7 - The default content looks something like this:

{
    "sections": {
        "main": {
            "type": "main-page",
            "disabled": false,
            "settings": {}
        }
    },
    "order": ["main"]
}

This template currently uses the same main content section as the standard page template. You can add additional sections here.

To add blocks inside those sections, see Add Blocks to a Shopify Section.


Adding sections to your custom template

To add a hero image section to your landing page template:

{
    "sections": {
        "hero": {
            "type": "image-banner",
            "settings": {
                "image_height": "large",
                "show_text_below": false
            }
        },
        "main": {
            "type": "main-page",
            "settings": {}
        },
        "testimonials": {
            "type": "multicolumn",
            "settings": {
                "title": "What our customers say"
            }
        }
    },
    "order": ["hero", "main", "testimonials"]
}

Important: The "type" value must match an actual section filename in your sections/ folder (without the .liquid extension). Use exact names.

The "order" array controls the sequence sections appear on the page.

To write a section file of your own, see Build a Custom Section in Shopify.


How do I assign a template to a page?

For pages:

  1. Go to Online Store → Pages → select the page
  2. Look at the right sidebar — find “Theme template”
  3. Select your new template from the dropdown (e.g., “page.landing”)
  4. Save

For products:

  1. Products → select the product
  2. Right sidebar → “Theme template”
  3. Select your template (e.g., “product.feature”)
  4. Save

For collections:

  1. Products → Collections → select the collection
  2. Right sidebar → “Theme template”
  3. Select your template

The template dropdown only shows templates that match the current content type — page templates for pages, product templates for products, etc.


Editing template content in the Theme Editor

Once a custom template is assigned to a page, you can customize it in the Theme Editor:

  1. Online Store → Themes → Customize
  2. Use the page selector at the top to navigate to the page using your custom template
  3. The sections defined in your JSON template appear in the left sidebar
  4. Edit section settings, add new sections (within the template’s scope), and reorder as needed

Changes made in the Theme Editor update the JSON template file automatically.

Build custom Shopify templates by describing what you want to Fudge.
Start free trial

How do I upload a template?

You can’t upload a pre-built template file directly via the Shopify admin UI. Instead:

  • Create templates in the Theme Editor or by adding new JSON files in the code editor (as described above)
  • Copy templates from another theme by copying the JSON content from one theme’s code editor and pasting it into a new file in your theme’s code editor
  • Import via Shopify CLI (for developers) — allows pushing theme files including templates from a local machine

For merchants, the Theme Editor’s Create template option is the simpler approach.


Common custom template use cases

Landing page template. No header navigation, no footer, full-width hero, single CTA (set "layout" to a layout without the header and footer). Assign to campaign pages from ads.

Feature product template. More immersive product page with a dedicated video section, expanded ingredient/material details, and a comparison table. Assign to hero products.

Brand story page. Large typography, full-width images, team section. Assign to About page.

Wholesale page. Different product pricing display, a form section, B2B-specific content. Assign to hidden wholesale pages.

For product page layouts, see Customize Your Shopify Product Page.


FAQ

Can I create a custom template without editing code?

Yes. Every Online Store 2.0 theme lets you create one in the Theme Editor: open the template dropdown at the top and choose "Create template", which generates a new JSON file behind the scenes. Beyond that, anything more advanced (renaming sections, custom JSON structure, importing templates) requires the code editor or a tool like Fudge, the AI operator for Shopify stores, that writes the template for you as a draft you preview before publishing.

How do I delete a custom template in Shopify?

In the code editor, open the templates/ folder, find the JSON file for your custom template, and click the three-dot menu → Delete. Before deleting, reassign any pages, products, or collections currently using that template to a different one - otherwise they'll fall back to the default template for that resource type.

Can I rename a custom template in Shopify?

Not directly. Shopify doesn't have a rename action. Instead, create a new template with the desired name, copy the JSON contents from the old one, reassign your pages/products/collections to the new template, and delete the old file.

Can I copy a custom template from one theme to another?

Yes. Open the source theme's code editor, copy the JSON from your custom template file. In the destination theme, create a new template with the same naming pattern (page.landing.json, etc.), and paste the JSON. Important: any sections referenced in the JSON ("type": "image-banner", etc.) must also exist in the destination theme, or the template will throw errors.

What's the difference between a Shopify template and a section?

A template is a JSON file that defines the layout of a specific page (which sections appear and in what order). A section is the building block - a Liquid file with HTML, CSS, and settings - that gets rendered inside a template. Templates compose sections; sections render content.

Jacques's signature
Build custom Shopify templates and sections by describing them.

You might also be interested in

Jacques Blom
Jacques Blom
CTO at Fudge.