{"title":"truncate - Liquid Filter Reference","slug":"truncate-filter-reference","url":"https://support.storeconnect.com/articles/truncate-filter-reference","url_markdown":"https://support.storeconnect.com/articles/truncate-filter-reference.md","subtitle":null,"summary":"Shortens a string to a maximum character count, appending an ellipsis by default. A second argument lets you customize or remove the trailing characters.","type":"Developer_Documentation","video_url":"","keywords":"liquid, filters, truncate, text, storeconnect","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"## Description\n\nShortens a string down to the number of characters passed as an argument. If the specified number of characters is less than the length of the string, an ellipsis (…) is appended to the string and is included in the character count.\n\n| Property | Value |\n|----------|-------|\n| **Return Type** | string |\n| **Category** | text |\n\n## Examples\n\n\n```liquid\n\n{{ \"Mary had a little lamb.\" | truncate: 15 }}\n```\n\n\n**Output:** `Mary had a l...`\n\n`truncate` takes an optional second argument that specifies the sequence of characters to be appended to the truncated string. By default this is an ellipsis (…), but you can specify a different sequence\n\n\n```liquid\n\n{{ \"Mary had a little lamb.\" | truncate: 15, \"--\" }}\n```\n\n\n**Output:** `Mary had a li--`\n\nYou can avoid showing trailing characters by passing a blank string as the second argument\n\n\n```liquid\n\n{{ \"Mary had a little lamb.\" | truncate: 15, \"\" }}\n```\n\n\n**Output:** `Mary had a litt`"}