Liquid is the open-source template language created by Shopify that renders storefront pages by combining fixed markup with live store data such as products, collections, carts and customer accounts. Among e-commerce store platforms, it is the layer that separates theme presentation from commerce logic: merchants and developers control what a page looks like, while Shopify keeps checkout, pricing and inventory on its own servers.
Liquid is deliberately safe and non-Turing-complete in practice: it cannot open files, call arbitrary code or run unbounded loops, which allows Shopify to execute millions of merchant-edited templates on shared infrastructure. Not to be confused with liquidity in finance or with unrelated products that share the name.
How Liquid renders a Shopify storefront
Liquid works as a server-side rendering step that runs every time a visitor requests a storefront page. Shopify selects the matching theme template, loads the relevant objects for that URL, evaluates every Liquid expression and sends finished HTML to the browser, often from a cached edge copy.
A template mixes plain HTML with three kinds of Liquid syntax. Objects in double curly braces print data, tags in curly-brace-percent delimiters control logic, and filters after a pipe character transform output. For example, {{ product.price | money }} reads the price in the smallest currency unit and formats it according to the store currency settings.
The following table summarizes the three building blocks and what each one does during rendering.
| Element | Delimiter | Purpose | Typical example |
|---|---|---|---|
| Objects | {{ }} | Output a value from store data | product.title, cart.item_count |
| Tags | {% %} | Control flow, loops and variable assignment | if, for, assign, render |
| Filters | Pipe after an object | Transform or format output | money, img_url, upcase, date |
| Whitespace control | Hyphen inside delimiters | Trim surrounding spaces and line breaks | {%- if -%} |
Because the language is sandboxed by design, a template can only read the objects Shopify exposes in that context. A product page can access product, a collection page can access collection, and global objects such as shop, settings and request are available everywhere.
Theme architecture and file types
Modern Shopify themes follow the Online Store 2.0 architecture, in which Liquid files are organized into layouts, templates, sections, blocks and snippets. Since that release, most page templates are JSON files that list sections, while the actual markup lives in Liquid section files that merchants can rearrange in the theme editor.
Each file type plays a distinct role in the rendering chain, as the next table shows.
| File type | Folder | Role | Editable by merchants |
|---|---|---|---|
| Layout | layout | Outer HTML shell, head tags and global scripts | No, code only |
| Template | templates | Defines which sections a page type uses | Yes, through the theme editor |
| Section | sections | Reusable module with its own schema and settings | Yes, add, remove and reorder |
| Block | blocks or inside sections | Smaller repeatable unit inside a section | Yes, add and reorder |
| Snippet | snippets | Partial file included with the render tag | No, code only |
Every section ends with a schema tag that declares settings in JSON. These settings generate the controls in the theme editor, so a developer writes Liquid once and a merchant later changes text, colors or product pickers without touching code. This division of labor is the main reason Liquid themes scale from small shops to Shopify Plus brands.
Liquid compared with other storefront approaches
Liquid represents the classic coupled storefront model, in which the platform hosts both the data and the rendering. Other store platforms and architectures make different trade-offs between control, speed of development and operational burden.
| Approach | Where rendering happens | Main strength | Main cost |
|---|---|---|---|
| Liquid themes | Shopify servers | Hosted, fast to launch, merchant editable | Limited logic, no custom server code |
| Shopify Hydrogen | Developer-hosted or Oxygen runtime | Full React control over the frontend | Higher build and maintenance effort |
| WooCommerce PHP templates | Merchant web server | Unrestricted PHP and plugin access | Hosting, security and updates are on the merchant |
| Generic headless frontend | Any framework or CDN | Channel independence | Separate content, preview and checkout integration |
In practice, Liquid remains the default for the large majority of Shopify stores, while headless commerce is chosen when a brand needs app-like interactivity or a shared frontend across several back ends. Many teams combine both, keeping checkout and account pages on Shopify while experimenting with custom frontends elsewhere.
Practical development with Liquid
Professional Liquid development relies on the Shopify CLI, which serves a local preview against real store data, syncs files to a development theme and runs Theme Check, a linter that flags deprecated tags, missing translations and performance problems. Version control through the GitHub integration keeps theme code reviewable.
The choice of technique depends on what the store needs, as the decision table below illustrates.
| Requirement | Recommended technique | Reason |
|---|---|---|
| Show extra product data | Metafields read in Liquid | Structured data without hardcoding text |
| Reusable UI fragment | render tag with snippets | Isolated scope prevents variable leaks |
| Merchant-controlled layout | Sections with schema settings | Editing happens in the theme editor |
| Responsive product images | image_url and image_tag filters | Shopify CDN resizes and serves modern formats |
| Dynamic cart updates | Section Rendering API with JavaScript | Refreshes Liquid output without a full reload |
Metafields and metaobjects deserve special attention because they extend the data model that Liquid can read. A developer defines a metafield such as material or care instructions, the merchant fills it per product, and the template prints it with product.metafields.custom.material, which keeps content and code cleanly separated.
Limitations and common mistakes
The sandbox that makes Liquid safe also defines its hard limits. It cannot call external APIs during rendering, cannot write data, and has no access to checkout pages on standard plans, which are customized through checkout extensibility rather than Liquid.
- Pagination limits: a for loop over a collection returns at most 50 items unless the paginate tag is used, and paginate allows up to 250 per page.
- Nested loops over large collections slow server rendering and can produce render timeouts on busy pages.
- Using include instead of render: the deprecated include tag shares variables with the parent template and makes bugs hard to trace.
- Hardcoded text instead of locale files blocks translation and multi-market selling.
- Logic in Liquid that belongs in apps, such as complex discount calculations, which should run in Shopify Functions instead.
A further misconception is that Liquid output is always fresh. Shopify caches rendered pages, so personalized content that varies per visitor is better loaded through JavaScript and the storefront APIs rather than computed in the template.
A non-technical view
Think of a Shopify store as a printed catalog that rewrites itself every time someone opens it. Liquid is the set of instructions that tells the system where to put each product name, photo and price on the page.
The designer writes the layout once and leaves blanks such as “insert price here.” When a shopper visits, Shopify fills in the blanks with current data. If a price changes or an item sells out, every page shows the update automatically, without anyone redesigning anything.
A concrete example
A mid-sized outdoor apparel store on Shopify sells 600 jackets, each with a different waterproof rating. The merchandising team wants that rating shown as a badge on product and collection pages, but the theme only displays title, price and images.
A developer creates a numeric product metafield for the waterproof rating in millimeters, adds a small snippet that prints a badge when the value is 10,000 or higher, and renders it in the product card and the main product section. The merchandisers then fill the field through a bulk spreadsheet import.
The change takes about one working day, requires no app subscription and no theme rebuild, and the badge updates automatically whenever the team edits a product. After launch, the store reports fewer customer questions about rain protection, because the key specification is now visible before shoppers open a product page.