What is Liquid?
Liquid is an open-source templating language created by Shopify in 2006. Unlike PHP or Ruby, Liquid does not execute arbitrary code on the server. Instead, it provides a strict, sandboxed vocabulary of tags, objects, and filters that transform templates into HTML before the response is sent to the browser.
When a customer visits your Shopify store, Shopify's servers read your theme files (.liquid, .json), merge them with live store data (products, prices, cart contents, customer session), and output plain HTML. The customer never sees Liquid syntax — only the rendered result.
Why Shopify Uses Liquid
Shopify hosts thousands of merchants on shared infrastructure. Liquid's sandbox prevents theme developers from opening files, running shell commands, or accessing other stores' data. This security model is why every Shopify theme — from free themes to enterprise custom builds — is built with Liquid at its core.
- Safe by design — merchants cannot break server security with theme code
- Separates presentation (HTML/CSS) from store data (products, orders)
- Readable by non-developers — merchants can edit text in the theme editor
- Extensible — Shopify adds objects like product, cart, and routes for commerce
Liquid in the Theme Rendering Pipeline
- Shopify receives an HTTP request (e.g. GET /products/web-development-course)
- The router selects a template (templates/product.json) and loads its sections
- Each section file (.liquid) is processed: tags run logic, {{ }} outputs values
- The layout (layout/theme.liquid) wraps the page with header, footer, and assets
- Final HTML is sent to the browser; JavaScript may enhance the page client-side
Your First Liquid Output
{% comment %}
Comments are stripped before render.
Use them to document complex logic for other developers.
{% endcomment %}
<h1>Welcome to {{ shop.name }}</h1>
<p>{{ shop.description }}</p>
<p>Currency: {{ shop.currency }} · Domain: {{ shop.domain }}</p>The shop object is available on every page of your theme. shop.name returns the store title from Shopify Admin → Settings → Store details. shop.currency returns the ISO currency code (e.g. USD, EUR) used for money filters.