Adding a Custom Taxonomy in Hugo to Group Content by Series
Learn how to add a custom taxonomy in Hugo—such as a 'series' grouping—by configuring the site, tagging content, and verifying the generated term pages.
02 May 2026, 08:30 UTC

Desired outcome
Create a custom taxonomy called "series" so that pages sharing the same series value are automatically grouped and accessible via URLs like /series/my‑series/.
Prerequisites
- Hugo installed (version 0.120 or newer recommended).
- An existing Hugo site initialized with
hugo new site mysite. - Basic familiarity with editing TOML/YAML/JSON configuration and Markdown front matter.
Procedure
- Define the taxonomy in the site configuration
Open the site’s config file (
hugo.toml,hugo.yamlorhugo.json) and add a taxonomies section. Example for TOML:[taxonomies] series = "series"If you use YAML, the equivalent is:
taxonomies: series: seriesSave the file.
- Add the taxonomy term to content front matter
For each Markdown content file that should belong to a series, include a front‑matter key matching the taxonomy name (case‑sensitive). Example:
--- title: "Building a Blog" date: 2026-09-01 series: ["Hugo Tutorials"] --- # Content hereYou can assign multiple series values by providing an array.
- (Optional) Create custom templates
Hugo provides default templates for taxonomies at
layouts/_default/taxonomy.html(list of terms) andlayouts/_default/term.html(pages for a single term). If you need custom markup, copy these files from Hugo’s internal templates or create them in your project.Example minimal
layouts/_default/term.html:{{ define "main" }} Series: {{ .Page.Title }}-
{{ range .Pages }}
- {{ .Title }} {{ end }}
- Build and preview the site
Run the development server from the site root:
hugo serverThe server watches for changes; no special permissions are required beyond read/write access to the project directory.
- Verify the generated taxonomy pages
After the build completes, check the following:
- Navigate to
http://localhost:1313/series/to see a list of all series terms. - Click a term (e.g., "Hugo Tutorials") to land on
http://localhost:1313/series/hugo-tutorials/and confirm that it lists all pages with that series value. - Inspect the
public/directory: you should findpublic/series/index.htmland a subfolderpublic/series/hugo-tutorials/index.html(or similar, depending on URLization).
- Navigate to
Expected checks
- The taxonomy list page renders without errors and shows term links.
- Each term page shows the correct set of content pages.
- Links from individual posts to their series term page work and lead to the term listing.
Recovery options
If the taxonomy does not appear as expected:
- Verify that the front‑matter key exactly matches the taxonomy name defined in the config (case‑sensitive).
- Check the config for typos; restart
hugo serverafter any change. - Remove the generated
public/folder and rebuild withhugo --minifyto ensure stale files are not interfering. - To revert, delete the taxonomy entry from the config and remove the corresponding front‑matter keys; then rebuild.
Limitations
- Each unique term creates a separate page; on very large sites with many distinct terms this can increase build time.
- Changing the taxonomy name in the config requires updating every content file that uses it; otherwise orphaned terms will be generated.
- Taxonomy terms are URLized automatically (lowercased, spaces to hyphens); ensure links in your content reflect this format if you hard‑code them.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.