strip_html

Strip all HTML tags and markup elements from a string, leaving only plain text.

Syntax

{{ html_string | strip_html }}

Example

{% assign html = "<h3>Featured</h3><p>Full description</p>" %}{{ html | strip_html }}

Output

FeaturedFull description

The strip_html filter scans an input string and removes every HTML opening and closing tag, leaving only plain, unformatted text characters behind.

In programmatic SEO workflows, strip_html sanitizes rich-text marketing copy for inclusion in plain-text meta descriptions, Open Graph cards, or image alt attributes. For example: <meta name="description" content="{{ row.body_html | strip_html | truncate: 155 }}">. This prevents unrendered HTML tags from leaking into search engine result page snippets.

Try this syntax in the editor.