# Disable html output format

**URL:** <https://discourse.gohugo.io/t/disable-html-output-format/42136>\
**Category:** support\
**Created:** [December 29, 2022, 11:33pm UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136 "2022-12-29T23:33:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sd991](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sd991](https://discourse.gohugo.io/u/sd991)\
**Post date:** [December 29, 2022, 11:33pm UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/1 "2022-12-29T23:33:50Z")

</div>

## Problem 1

I want to disable HTML outputs for kind `pages`. But I want to enable it for kind `section`.  
However I see that Hugo generates html files for kind `pages` even after setting `disableKinds = ['page']` in `config.toml`.

## Problem 2

I also observed that Hugo generates the following files on it’s own. I have neither provided any sitemap templates nor configured my site for taxonomy (in my `config.toml`).

```auto
http://localhost:1313/sitemap.xml
http://localhost:1313/tags/index.html
http://localhost:1313/tags/index.xml
http://localhost:1313/categories/index.html
http://localhost:1313/categories/index.xml

```

Link to repo: [techieforgood/hugo-csv (github.com)](https://github.com/techieforgood/hugo-csv)  
To run the site after cloning you need to use:

```auto
cd exampleSite; hugo server --cleanDestinationDir --themesDir ../../ -t hugo-theme-console

```

PS: My work is a fork of hugo-theme-console

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 30, 2022, 12:26am UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/2 "2022-12-30T00:26:53Z")

</div>

[https://github.com/techieforgood/hugo-csv/blob/main/exampleSite/config.toml#L17](https://github.com/techieforgood/hugo-csv/blob/main/exampleSite/config.toml#L17)

Move this to the root table. It is currently in the `params` table.

To disable the others:

```auto
disableKinds = ['RSS','sitemap','taxonomy','term']

```

---

<div class="post-metadata">

**Author:** ![sd991](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sd991](https://discourse.gohugo.io/u/sd991)\
**Post date:** [December 30, 2022, 3:59am UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/3 "2022-12-30T03:59:38Z")

</div>

Hi @jmooring . Thanks a lot for the answer. That worked like a charm.

But for the sake of clarity, I have a question.  
Why Hugo generates many things (sitemaps,/tags/,/categories/) on its own? Then we have to disable the automatic generation using `disableKinds`.

Should it not be other way round? Hugo should not generate all these on its own. We should specify what we want Hugo to generate.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 30, 2022, 4:07am UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/4 "2022-12-30T04:07:42Z")

</div>

> [@sd991](#):
>
> Hugo should not generate all these on its own

The `tags` and `categories` taxonomies are enabled by default, making it easier for a new user to get started. All they have to do is add a `tags` or `categories` array to front matter and it just… works.

Most people want a sitemap, and by enabling it by default they don’t have to think about it. It just… works. Same with RSS.

And theme authors rely on these defaults.

We spend a lot of time and energy to make sure that the defaults are sensible, but they will never be right for everyone.

---

<div class="post-metadata">

**Author:** ![sd991](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sd991](https://discourse.gohugo.io/u/sd991)\
**Post date:** [December 30, 2022, 4:40am UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/5 "2022-12-30T04:40:36Z")

</div>

Thanks for the explanation @jmooring .

> [@jmooring](#):
>
> but they will never be right for everyone

I understand that.

So, I set `disableKinds = ['pages','RSS','sitemap','taxonomy','term']` in the root table.

But that leads to a problem. Looks like the section list pages don’t have access to the markdown files now.

Here is what I mean:

### Before setting `disableKinds`

The list page works as expected.  
The csv output format (at section level) works as expected.  
The single pages are generated as expected.

### After setting `disableKinds`

The list page shows nothing.  
The csv file shows nothing.  
The page html pages are not generated as expected.

Here is a [screenshot](https://imgur.com/a/FqUJqly) of the 6 things I mentioned above.

### Problem

1. I did not want the CSV and HTML list pages to go blank.
2. I want to suppress the generation of single page HTML pages

Is there a way to achieve these ?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 30, 2022, 4:42am UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/6 "2022-12-30T04:42:47Z")

</div>

See docs:  
[https://gohugo.io/content-management/build-options/](https://gohugo.io/content-management/build-options/)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 30, 2022, 5:02am UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/7 "2022-12-30T05:02:43Z")

</div>

And keep in mind you can “cascade” the build options from your site configuration.

config.toml

```plaintext
disableKinds = ['RSS', 'sitemap', 'taxonomy', 'term']

[[cascade]]

[cascade._build]
list = 'local'
render = 'never'
publishResources = 'false'

[cascade._target]
kind = 'page'
path = '/posts/**'

```

[https://gohugo.io/content-management/front-matter/#front-matter-cascade](https://gohugo.io/content-management/front-matter/#front-matter-cascade)

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [December 30, 2022, 10:04pm UTC](https://discourse.gohugo.io/t/disable-html-output-format/42136/8 "2022-12-30T22:04:39Z")

</div>

I’m not sure this will add anything of importance to that thread, but by reading the title, it seems what you wanted to do was to disable specifically the `html` output formats, and maybe you still wanted the `RSS` or json etc… In which case you should look at the [ouputs](https://gohugo.io/templates/output-formats/#customizing-output-formats) config.

This can be set in the Front Matter, so also available with cascade.
