- 15 Sep 2025
- 2 minute read
- Print
- DarkLight
- PDF
Liquid Markup Filters
- Updated 15 Sep 2025
- 2 minute read
- Print
- DarkLight
- PDF
In Liquid markup, filters let you transform data before it’s displayed.
This can be useful for modifying the returned value of merge fields or exports, without making adjustments to the underlying query.
Liquid provides a number of standard filter keywords, which we describe in this article.
✨ Prompting Slate AI
Ask Slate AI for help working with Liquid markup filters:
💬 Help me format a list of dates from a Liquid loop so each one appears as 'Day of week, Month Day' using date filters.
💬 How do I sort a list of awards by amount using the sort filter and display them from highest to lowest?
💬 Help me remove extra whitespace in a text field using the strip filter in my portal content.
How Liquid markup filters work
Add filters to text or a merge field you want to modify:
In a Liquid markup object
{{ }}
, enter some text in quotes, or the name of a merge field:{{"Hello world"}}
Add a pipe delimiter after that content:
{{"Hello World" | }}
Add the filter keyword after the pipe delimiter:
{{"Hello World" | upcase }}
The filter takes that text or export and transforms it accordingly: HELLO WORLD
Examples
Following the previous example, say you have an export, such as {{academic-intererests}}
, that you want to be all lowercase.
You can use downcase
:
{{academic-interests | downcase}}
Which renders the value of academic-interests
(say, Biology) as:
biology
Standard Liquid filters
The following are standard filters that can operate on Slate exports and plain text:
Filter | Function | Example |
---|---|---|
| Allow you to pass in a value and output a content block. Interchangeable with ‘snippet’. |
|
| Formats a date |
|
| Divides two numbers |
|
| Sets all letters to lowercase |
|
| Returns the first element of an array |
|
| Returns the last element of an array |
|
| Returns only the specified elements in an array |
|
| Subtracts two numbers |
|
| Returns the remainder after division |
|
| Adds two numbers |
|
| Replaces the first occurrence of a match |
|
| Returns the number of elements in an array or the number of characters in a string |
|
| Allow you to pass in a value and output a content block. Interchangeable with ‘block’. |
|
| Splits a string into an array on a matching criteria |
|
| Removes HTML tags from a string |
|
| Multiples two numbers |
|
| Dedupes values in an array |
|
| Sets all letters to uppercase |
|
| Limits results based on specific criterion. To include an item, both comma-separated variables should return the same value. |
|
Chaining filters
You can chain filters together to perform several actions in a row on the same export.
Filters work from left to right: each subsequent filter processes the output rendered by the previous one.
In this example, we take the value of the academic-interest
export and render it in all lowercase with downcase
. Then, the lowercase academic interest is shortened by truncate
to the specified 10
characters:
{{academic-interests | downcase | truncate: 10}}
So, a program like Environmental Sciences
would display as environmen
.
📖 Further reading: See the Shopify documentation on Liquid markup filters.