# Comments in Markdown files or front matter?

**URL:** <https://talk.jekyllrb.com/t/comments-in-markdown-files-or-front-matter/9060>\
**Category:** Help\
**Created:** [March 28, 2024, 8:50am UTC](https://talk.jekyllrb.com/t/comments-in-markdown-files-or-front-matter/9060 "2024-03-28T08:50:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VillyVretthorn](https://avatars.discourse-cdn.com/v4/letter/v/a587f6/32.png) [@VillyVretthorn](https://talk.jekyllrb.com/u/VillyVretthorn)\
**Post date:** [March 28, 2024, 8:50am UTC](https://talk.jekyllrb.com/t/comments-in-markdown-files-or-front-matter/9060/1 "2024-03-28T08:50:23Z")

</div>

Hi,

I often find myself wanting to store some meta info in a page. This could be notes for myself about why I wrote as I did, etc.

I can put inline HTML comments like: `<!-- comment -->`, however, this will expose these comments publicly, which is _not_ what I want.

How can I put comments in a page to have Jekyll just ignore it and not publish it?

Either in the actual Markdown content (preferably) or alternatively, in the front matter?

---

<div class="post-metadata">

**Author:** ![panchtatvam](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/panchtatvam/32/5512_2.png) [@panchtatvam](https://talk.jekyllrb.com/u/panchtatvam)\
**Post date:** [March 28, 2024, 9:03am UTC](https://talk.jekyllrb.com/t/comments-in-markdown-files-or-front-matter/9060/2 "2024-03-28T09:03:09Z")

</div>

For templates the following works.  
Do try if these work for markdown as well :

```auto
{% comment %} 
    These commments will not include inside the source.
{% endcomment %}

```

---

<div class="post-metadata">

**Author:** ![michaelbach](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelbach/32/2151_2.png) [@michaelbach](https://talk.jekyllrb.com/u/michaelbach)\
**Post date:** [March 29, 2024, 5:47am UTC](https://talk.jekyllrb.com/t/comments-in-markdown-files-or-front-matter/9060/3 "2024-03-29T05:47:29Z")

</div>

Another approach: Use the `compress.html` layout ([http://jch.penibelst.de/](http://jch.penibelst.de/)), that removes comments from the build.

---

<div class="post-metadata">

**Author:** ![VillyVretthorn](https://avatars.discourse-cdn.com/v4/letter/v/a587f6/32.png) [@VillyVretthorn](https://talk.jekyllrb.com/u/VillyVretthorn)\
**Post date:** [April 23, 2024, 3:45pm UTC](https://talk.jekyllrb.com/t/comments-in-markdown-files-or-front-matter/9060/4 "2024-04-23T15:45:34Z")

</div>

compress.html is fantastic! Thanks
