Scaling Your Shopify Theme: Avoiding Pitfalls with JSON Templates and Section Settings

Hey everyone! As a Shopify migration expert and someone who spends a lot of time sifting through community discussions, I often see recurring themes (pun intended!) around managing the complexity of growing Shopify stores. One topic that recently caught my eye in the forums, thanks to a great discussion started by @angelina-new-user and @alinacarrie, was about handling JSON templates and section schemas in large Shopify themes. It's a critical area, especially for store owners who want highly customizable, future-proof layouts without getting bogged down in technical debt.

The core idea, as @alinacarrie eloquently put it, is about building “modular, highly adjustable sections with rich schemas” instead of lots of “unflexible, one-use pieces.” This approach promises theme bloat prevention and better codebase maintainability. Sounds ideal, right? But as the discussion unfolded, some really important nuances and “gotchas” came to light that every store owner, or anyone managing a Shopify theme, needs to be aware of.

The “Shared Data” Illusion: A Core Shopify Theme Challenge

One of the most eye-opening points, brought up by @lumine, is something that “bit hardest on big themes.” It’s the fact that section data can’t be shared across JSON templates. Think about that for a second. If you have a fantastic “Hero” section that you want to use on 12 different pages (each with its own JSON template), you’re not actually linking to one central hero. Instead, each of those 12 templates holds its own independent copy of that hero section’s settings. Each JSON template has its own sections object, keyed by section ID.

What does this mean for you? If you decide to change the schema for that hero section – maybe adding a new field or renaming an old one – you don’t just update one place. You potentially have 12 places where old values are still stored. This leads us directly to the next crucial insight.

Your Section Settings are a Contract (An API, Really!)

@lumine wisely suggests that we stop thinking of a section merely as a layout and start treating it as a “settings contract.” This means that once you define a setting ID, it becomes like an API endpoint that you absolutely do not want to rename. Why?

  • Renaming Setting IDs: If you rename something like heading_size to title_size in your schema, any existing instances of that section on your live pages will quietly fall back to the schema’s default value for that setting. The old heading_size value just sits there, orphaned in the template JSON, never to be used again. Your merchant’s carefully chosen setting is gone!
  • Renaming Section Files (Type): The same applies to the section type, which is essentially the filename of your section. Change the filename, and every reference to that section type in your JSON templates gets orphaned, breaking those sections on your pages.

The takeaway here is clear: plan your setting IDs and section filenames carefully from the start. Stability is key to preserving your client’s content and customizer settings.

Hitting the Limits: What Shopify Allows

It’s also vital to be aware of Shopify’s built-in limits, which can quickly become constraints in a large theme:

  • 25 sections per JSON template: This means you can’t just stack an infinite number of sections on a single page.
  • 50 blocks per section: If you’re building highly dynamic sections with lots of nested content, that 50-block budget can be eaten up faster than you’d expect, especially with deep nesting.
  • 1000 JSON templates per theme: While generous, this is a limit to keep in mind for truly massive, custom-page-heavy stores.

Understanding these limits helps you design more efficiently and avoid hitting unexpected roadblocks down the line.

Upgrading Without Breaking Client Content: The Presets Trap

One of the trickiest parts of managing a large theme is upgrading it without destroying existing client content or customizer settings. @lumine pointed out a significant “trap” related to presets:

Presets only fire when someone adds the section from the “Add section” picker in the theme customizer. This means that if you update a preset with new default values or settings, any existing instances of that section on your pages will not automatically adopt those new preset values. They’ll continue to use the settings they had when they were originally added.

So, what’s the solution? When you’re making a schema change and adding new settings, always ship them with a default value that reproduces the *current rendered output* of existing sections. Don’t set a default that “improves” it, as this could suddenly change how your client’s live pages look. The goal is a seamless, non-breaking update.

Navigating GitHub Integration and Collaboration

For those of you using GitHub for theme development, there’s another subtle but critical trap: Shopify’s GitHub integration commits theme editor changes back to your connected branch. This behavior, as @lumine highlighted, can’t be disabled.

Imagine this scenario: your development team is working on a new feature branch, and your client is simultaneously making tweaks in the theme customizer on the live theme (which is connected to your main branch). Any merge that touches JSON templates could silently revert your client’s customizer work! To avoid this headache, it’s best practice to keep template JSON files out of your pull request (PR) diffs unless changing those specific JSON templates is the primary purpose of that PR.

Final Thoughts

Managing JSON templates and section schemas in a large Shopify theme can indeed get very complicated, as @angelina-new-user noted. The community discussion really underscores that while building modular, reusable sections is a fantastic goal, it comes with a set of specific architectural considerations and potential pitfalls unique to Shopify’s theme architecture.

By understanding that section data isn’t shared, treating your setting IDs as immutable contracts, respecting Shopify’s limits, being strategic about schema upgrades, and carefully managing your GitHub workflow, you can build truly robust, scalable, and maintainable themes that empower store owners without creating future headaches. It’s all about foresight and embracing the nuances of the platform!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases