Skip to content

Replace ​

Replaces all instances of a substring with a different string.

liquid
{{ string | replace: substring, replacement }}

Example ​

liquid
{{ 'red shirt, red hat' | replace: 'red', 'blue' }}

Output

html
blue shirt, blue hat