Disable Categories and Tags Pages in Hugo Website
Disable Taxonomy and Term Pages in Hugo Website
Page content
In this tutorial, we’ll learn how to disable taxonomy and term pages (such as Categories and Tags) in Hugo website.
Overview
When you generate a website using Hugo static site generator. Hugo automatically create taxonomies for tags and categories and generates the following pages by default:
- Taxonomy Pages for Categories
/categoriesand Tags/tagswhich list out all the categories and tags of the website. - Term Pages for Category e.g.
/categories/technologyand Tag e.g./tags/trendingwhich list out all the posts belongs to that category or tag.
You can disable the default behavior of generating taxonomy and term pages.
Why Disable Taxonomy Pages?
Categories and tags are genuinely useful once a site has enough posts that readers need a way to browse by topic. On a small or early-stage site, though, a taxonomy page listing two or three posts adds little value to a visitor and can actively hurt SEO: search engines see a /tags/foo page whose entire content is a couple of excerpts already indexed on their own post pages, which reads as thin or duplicate content. Spread across dozens of one-off tags, that’s a lot of low-value pages competing with your real content for crawl budget and diluting the site’s overall content-quality signal. If you’re not deliberately building out topic hubs, turning taxonomy generation off keeps the site’s index limited to pages that actually earn their place.
Disable Taxonomy and Term Pages
Now you know about taxonomy and term pages. There are two ways to disable them.
Disable using config.toml
This approach is recommended, when you want to disable taxonomy and term pages permanently everytime you build your website.
Add the "taxonomy" and "term" values to the disableKinds configuration variable in your configuration file.
config.toml
title = "Hugo example site"
baseurl = "https://www.example.com"
disableKinds = ["taxonomy", "term"]
[taxonomies]
category = "categories"
tag = "tags"
Disable using command-line
This approach is recommended, when you want to disable taxonomy and term for a specific build of your website.
Execute following command from terminal to disable them:
hugo --disableKinds=taxonomy,term
To serve website in the localhost environment, execute following command:
hugo server --disableKinds=taxonomy,term
Taxonomy vs. Term: Two Different Kinds
taxonomy and term aren’t interchangeable, and mixing them up is the most common reason people find their tags “half disabled.” Building a test site and toggling each value independently confirms the distinction Hugo’s page kinds are actually built on:
taxonomycontrols the list-of-all-terms page —/tags/and/categories/, the index that lists every tag or category on the site.termcontrols each individual term page —/tags/trending/, the page that lists every post taggedtrending.
Disabling only "taxonomy" removes /tags/ and /categories/ but every individual /tags/trending/-style page still builds. You need both values in disableKinds to remove taxonomy pages entirely — which is exactly why the config example above lists them together.
Tradeoffs to Consider
Before disabling taxonomies site-wide, weigh a few consequences:
- You lose tag/category browsing. Readers can no longer click a tag to see related posts — if your theme’s menu or sidebar links to
/tags/...or/categories/...URLs (a “Recent Posts by Category” widget, for example), those links now 404 once the pages stop building. - Existing inbound links break. If a tag or category page has already been indexed or linked to from elsewhere, disabling it turns that URL into a dead link with no automatic redirect — plan a redirect if the page has real backlinks or search traffic.
- It’s all-or-nothing per kind.
disableKindsturns taxonomy and term pages off site-wide; it can’t selectively keep/tags/while dropping only a handful of low-value tags. If you only want to prune a few, removing the tag from the post’s front matter is the more targeted fix.