Remove HTML Comments

Please log in or register to do it.

This tool takes HTML content as input and removes HTML comments according to the chosen mode. Use the provided radio buttons to select a mode. If you choose to remove only comments matching a pattern, specify the text pattern in the custom field. Conditional comments (used in legacy IE code) can be optionally retained.

Processing Modes:


Removes every HTML comment from the content.

Removes only comments that contain a specific pattern.

Removes all comments but preserves conditional comments (e.g. for IE).

Examples:

Remove All HTML Comments

Strips every comment from the HTML.

Before:
<p>Hello <!-- This is a comment --> World</p>
After:
<p>Hello  World</p>

Remove Only Comments Matching a Pattern

Removes only comments that contain the pattern "DEBUG".

Before:
<p>Hello <!-- DEBUG: remove this comment --> World</p>
<p>Keep this <!-- NOTE: keep this comment --> intact</p>
After (with pattern "DEBUG"):
<p>Hello  World</p>
<p>Keep this <!-- NOTE: keep this comment --> intact</p>

Remove All Except Conditional Comments

Removes standard comments while keeping conditional comments.

Before:
<p>Hello <!-- Remove this comment --> World</p>
<!--[if IE]>Special instructions for IE<![endif]-->
After:
<p>Hello  World</p>
<!--[if IE]>Special instructions for IE<![endif]-->
Remove Inline Styles
Remove HTML Attributes

Your email address will not be published. Required fields are marked *