# How to disable comments in specific pages?

**URL:** <https://discourse.gohugo.io/t/how-to-disable-comments-in-specific-pages/22177>\
**Category:** support\
**Created:** [December 5, 2019, 7:48pm UTC](https://discourse.gohugo.io/t/how-to-disable-comments-in-specific-pages/22177 "2019-12-05T19:48:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![plicatibu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/plicatibu/32/10104_2.png) [@plicatibu](https://discourse.gohugo.io/u/plicatibu)\
**Post date:** [December 5, 2019, 7:48pm UTC](https://discourse.gohugo.io/t/how-to-disable-comments-in-specific-pages/22177/1 "2019-12-05T19:48:59Z")

</div>

Hi, all.

I have comments enalbed (gitalk to be exactly). It works perfect byt I want to disable comments in specific pages( for instance, Terms of Use and Privacy Service pages).

My first attempt was to make a copy of

`themes/zzo/layouts/_default/single.html`

to

`layouts/_default/single.html`

and edit it to remove comments snippet. The problem is that it removed comments from all pages.

Could someone point me how to do it?

Thank you.

Notes:

I’m using

- Hugo version 0.60.1
- Zzo theme (updated yesterday)

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [December 6, 2019, 12:59am UTC](https://discourse.gohugo.io/t/how-to-disable-comments-in-specific-pages/22177/2 "2019-12-06T00:59:12Z")

</div>

> **[Introduction to Hugo Templating](https://gohugo.io/templates/introduction/#conditionals)**
>
> Hugo uses Go's \`html/template\` and \`text/template\` libraries as the basis for the templating.

You still need to decide how a page knows if comments should show. Adding an option to a page’s frontmatter works for that.

---

<div class="post-metadata">

**Author:** ![nfriedli](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nfriedli/32/26027_2.png) [@nfriedli](https://discourse.gohugo.io/u/nfriedli)\
**Post date:** [December 6, 2019, 3:56pm UTC](https://discourse.gohugo.io/t/how-to-disable-comments-in-specific-pages/22177/3 "2019-12-06T15:56:54Z")

</div>

In your layout ([https://github.com/zzossig/hugo-theme-zzo/blob/2e0f52a48f7aaa31f19b09a65e020744531fba3d/layouts/partials/comments/comments.html](https://github.com/zzossig/hugo-theme-zzo/blob/2e0f52a48f7aaa31f19b09a65e020744531fba3d/layouts/partials/comments/comments.html)), something like:

```
    {{ if not .Params.noComment }}
        Comment
    {{ end }}

```

In your frontmatter (yaml):

```
noComment: true
```

---

<div class="post-metadata">

**Author:** ![plicatibu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/plicatibu/32/10104_2.png) [@plicatibu](https://discourse.gohugo.io/u/plicatibu)\
**Post date:** [December 23, 2019, 3:16am UTC](https://discourse.gohugo.io/t/how-to-disable-comments-in-specific-pages/22177/4 "2019-12-23T03:16:56Z")

</div>

Sorry guys for taking so long to reply.

@nfriedli Your answer solved my problem. Thanks.

And thank you @maiki for pointing me the docs.
