Is It Possible to Comment Out HTML Code in a Wordpress Post?

Viewed 35535

Sometimes I need to inject some raw HTML code into a Wordpress post, and sometimes I need to comment out a chunk of that code.!

With a plain text editor, I can just use <!-- Comment --> around the chunk I want to hide.

But when I try this in a WP post, it does hide the code but I still see the "closing comment tag" -->.

What's the right way, if possible, to comment out code in a WP post?

Thanks!

8 Answers

Use a hidden div block

like this:

<div style="display: none;">

...comment...

</div>

works like a charm

Related