Supported Liquid filters

Filters transform a value. Unknown filters fail instead of silently doing nothing.

Text

append, capitalize, downcase, escape, escape_once, lstrip, newline_to_br, prepend, remove, remove_first, remove_last, replace, replace_first, replace_last, rstrip, slice, split, strip, strip_html, strip_newlines, truncate, truncatewords, upcase, url_decode, url_encode

Numbers

abs, at_least, at_most, ceil, divided_by, floor, minus, modulo, plus, round, sum, times

Lists and general values

compact, concat, date, default, first, join, last, map, reverse, size, sort, sort_natural, uniq, where, raw

Upstorr safety and media

  • plain_text removes markup and returns readable text.
  • safe_rich_text sanitizes merchant rich text for approved display.
  • link_url normalizes a theme link before placing it in href.
  • json produces JSON text for safe data serialization.
  • setting reads a named key from a settings object with an optional fallback.
  • transparent_color turns a supported colour into a transparent version.
  • media_url and media_alt read approved media fields.
  • video_url, video_sources and video_poster read uploaded-video data.
  • money formats a numeric amount using the current or supplied currency.
  • money_with_currency includes the currency code.

Examples

<a href="{{ product.url | link_url }}">{{ product.title | escape }}</a>
<span>{{ product.price | money }}</span>
{{ page.content | safe_rich_text }}

money requires a real numeric amount and currency. It does not calculate prices, discounts, GST or totals.