{"title":"csv_escape - Liquid Filter Reference","slug":"csv-escape-filter-reference","url":"https://support.storeconnect.com/articles/csv-escape-filter-reference","url_markdown":"https://support.storeconnect.com/articles/csv-escape-filter-reference.md","subtitle":null,"summary":"Escapes a single value for use as a CSV cell, quoting it when it contains a comma, double quote, or line break. Use it when you write a CSV row by hand rather than with the `csv` filter.","type":"Developer_Documentation","video_url":"","keywords":"liquid, filters, csv_escape, text, csv, feeds, escape, storeconnect","last_modified":"2026-11-25T21:09:53+0000","body_markdown":"## Description\n\nEscapes a value for a CSV cell (RFC 4180). A value that contains a comma, double quote, carriage return, or line feed is wrapped in double quotes, and any double quote inside it is doubled. Any other value is returned unchanged.\n\nIt escapes CSV structure only. It does not guard against spreadsheet formula injection.\n\nIn a CSV feed, interpolated values are already escaped this way, so `csv_escape` is optional there. A value you pass through it is marked as encoded and is not escaped a second time.\n\n| Property | Value |\n|----------|-------|\n| **Return Type** | string |\n| **Category** | text |\n\n## Examples\n\n\n```liquid\n\n{{ \"Fridgetastic 3000\" | csv_escape }}\n```\n\n\n**Output:** `Fridgetastic 3000`\n\n\n```liquid\n\n{{ \"Beans, rice and more\" | csv_escape }}\n```\n\n\n**Output:** `\"Beans, rice and more\"`\n\n\n```liquid\n\n{{ 'say \"hi\"' | csv_escape }}\n```\n\n\n**Output:** `\"say \"\"hi\"\"\"`"}