Provides a Twig filter that removes HTML comments.
Requirements
- Drupal 10 or 11
- PHP 7.2+
Usage:
{# Print result as markup render array. #}
{{ content.field_my_field|render|remove_html_comments }}
{# Print result as string. #}
{{ content.field_my_field|render|remove_html_comments_as_string }}
Supporting organizations:
Initial development
Project information
- Project categories: Developer tools
- Ecosystem: Twig Filter
1,308 sites report using this module
- Created by orlando.thoeny on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
8.x-1.0
released 31 March 2026
Works with Drupal: ^10 || ^11
Add drupal 11 support
Install:
Development version: 8.x-1.x-dev updated 31 Mar 2026 at 20:51 UTC



