All guides

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.

01

escape

Escapes HTML characters so text is displayed safely rather than parsed as markup.

{{ '<p>Hi</p>' | escape }}
02

append

Adds a string to the end.

{{ 'sale' | append: '.jpg' }}  → sale.jpg
03

prepend

Adds a string to the start.

{{ 'world' | prepend: 'Hello ' }}
04

size

Number of characters in a string or items in an array.

{{ product.tags | size }}
{% if cart.items.size > 3 %}
05

join

Joins an array into a string with a separator.

{{ product.tags | join: ', ' }}
06

downcase / upcase

Converts a string to lower or upper case.

{{ product.title | upcase }}
07

strip_html

Removes all HTML tags.

{{ product.description | strip_html }}
08

strip_newlines

Removes line breaks.

{{ article.excerpt | strip_newlines }}
09

truncate

Shortens a string to a character count. The count includes the ellipsis.

{{ product.description | strip_html | truncate: 120 }}
10

truncatewords

Shortens a string to a number of words.

{{ article.content | strip_html | truncatewords: 30 }}
11

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' }}
12

first / last

Returns the first or last item of an array.

{{ product.images | first }}
{{ collection.products | last }}
13

newline_to_br

Converts line breaks into <br> tags.

{{ cart.note | newline_to_br }}
14

replace / replace_first

Replaces every, or only the first, occurrence of a substring.

{{ product.title | replace: '-', ' ' }}
15

remove / remove_first

Removes every, or only the first, occurrence of a substring.

{{ 'Hello, world, hello' | remove: 'hello' }}
16

split

Splits a string into an array on a separator.

{% assign sizes = 'S,M,L' | split: ',' %}
17

plus / minus

Adds or subtracts a number. Related filters: times, divided_by, modulo, round.

{{ forloop.index | plus: 1 }}
{{ product.price | minus: 500 | money }}

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