Guide
Shopify Liquid Cheat Sheet 2026
Standard Liquid Filters (Text, Arrays and Maths)
Filters change output. They follow a pipe, take arguments after a colon, and can be chained left to right.
escape
Escapes HTML characters so text is displayed safely rather than parsed as markup.
{{ '<p>Hi</p>' | escape }}append
Adds a string to the end.
{{ 'sale' | append: '.jpg' }} → sale.jpgprepend
Adds a string to the start.
{{ 'world' | prepend: 'Hello ' }}size
Number of characters in a string or items in an array.
{{ product.tags | size }}
{% if cart.items.size > 3 %}join
Joins an array into a string with a separator.
{{ product.tags | join: ', ' }}downcase / upcase
Converts a string to lower or upper case.
{{ product.title | upcase }}strip_html
Removes all HTML tags.
{{ product.description | strip_html }}strip_newlines
Removes line breaks.
{{ article.excerpt | strip_newlines }}truncate
Shortens a string to a character count. The count includes the ellipsis.
{{ product.description | strip_html | truncate: 120 }}truncatewords
Shortens a string to a number of words.
{{ article.content | strip_html | truncatewords: 30 }}date
Formats a date with strftime codes, or with a named format from your theme's locale file.
{{ article.published_at | date: '%B %d, %Y' }}
{{ article.published_at | date: format: 'abbreviated_date' }}first / last
Returns the first or last item of an array.
{{ product.images | first }}
{{ collection.products | last }}newline_to_br
Converts line breaks into <br> tags.
{{ cart.note | newline_to_br }}replace / replace_first
Replaces every, or only the first, occurrence of a substring.
{{ product.title | replace: '-', ' ' }}remove / remove_first
Removes every, or only the first, occurrence of a substring.
{{ 'Hello, world, hello' | remove: 'hello' }}split
Splits a string into an array on a separator.
{% assign sizes = 'S,M,L' | split: ',' %}plus / minus
Adds or subtracts a number. Related filters: times, divided_by, modulo, round.
{{ forloop.index | plus: 1 }}
{{ product.price | minus: 500 | money }}Shopify stores that convert, rank higher, scale and sell more.
Builds, SEO and CRO from a Shopify Plus partner team.
Monthly send · Unsubscribe any time · Privacy policy
Shopify experts
Let's talk ecommerce, Shopify & Shopify Plus solutions.
DROPSHIP HUBS helps ecommerce brands build, improve, and grow Shopify stores. We support new builds, migrations, ongoing development, SEO, and conversion optimisation.
Our team can help plan the right approach based on your store, goals, and current challenges.
Get in touch




