Diagnosing Invisible Hugo Pages: A Step‑by‑Step Checklist
When a Markdown file under content/ disappears from your built site with no build error, it’s usually a filter, not a bug. This guide walks through the most common causes—drafts, dates, ignore patterns, template lookups—provides a diagnostic table, concrete commands, and when to raise the issue.
12 Jul 2026, 09:04 UTC

Recognizable Condition
During a hugo build you notice a Markdown file under content/ is missing from the public/ tree and does not appear in section listings. No error or warning is emitted. The page is silently filtered out.
Common Causes
Hugo intentionally excludes pages based on front‑matter flags and dates. The most frequent culprits are:
- Draft flag –
draft: truecauses the page to be omitted unless--buildDrafts (-D)is used. - Future/Expired dates –
date,publishDate,expiryDateoutside the current time window exclude the page unless--buildFuture (-F)or--buildExpired (-E)is passed. - Ignore patterns –
ignoreFilesinconfig.tomlcan match the file name or path. - Template lookup order – a missing or misnamed layout may render an empty page instead of an error.
- Section outputs –
outputsconfiguration that omits HTML for a section can hide the page from the final site.
Diagnostic Table
| Finding | What to Check | Command/Action | Expected Result |
|---|---|---|---|
| Draft flag | Front matter contains draft: true |
hugo --buildDrafts |
Page appears in public/ |
| Future date | Front matter date > current time |
hugo --buildFuture |
Page appears in public/ |
| Expired date | Front matter expiryDate < current time |
hugo --buildExpired |
Page appears in public/ |
| Ignore pattern | File path matches ignoreFiles glob |
Run hugo config | grep ignoreFiles |
Adjust glob or move file |
| Template missing | Layout not found for page type | Use hugo --debug to see lookup order |
Provide correct layout or rename |
Ordered Checks
- Verify Draft Status
Open the file and look for
draft: true. If present, run:hugo --buildDrafts -DCheck
public/for the page. If it appears, the issue is the draft flag. - Inspect Dates
Confirm the
date,publishDate, andexpiryDatefields. Ensure they are in ISO 8601 (e.g.,2026-10-12T10:00:00Z) and that the server clock matches the timezone used.Run:
hugo --buildFuture -F --buildExpired -EIf the page shows, adjust the dates or add the appropriate flag to your CI build.
- Check ignoreFiles
Run:
hugo config | grep -i ignoreFilesReview the glob patterns. If the file path matches, either rename the file or modify the pattern.
- Validate Template Lookup
Hugo selects a layout based on the page type and the
layoutsfolder hierarchy. Add a debug snippet to the list template to confirm the page is considered:{{/* layouts/_default/list.html */}} {{/* Debug: print every file processed */}} {{- range .Pages -}}{{ .File.Path }}{{- end -}}Rebuild. If the file never appears in the debug output, the page is filtered before template rendering.
- Inspect Section Output Settings
Open
config.tomland look for anoutputssection that excludesHTMLfor the page’s section. Example:[outputs]Adjust to include
HTMLor remove the restriction.
Fixes by Finding
- Draft – Remove
draft: trueor add-Dto the production build. - Future/Expired – Correct the date or add
-F/-Eto the build command. - IgnoreFiles – Update the glob in
config.tomlor relocate the file. - Template – Create or rename the layout file to match Hugo’s lookup order (e.g.,
layouts/_default/single.htmlfor all pages). - Outputs – Ensure the section’s output list includes
HTML.
Escalation Criteria
If after all checks the page still builds but renders empty or with a wrong layout, the problem is deeper:
- Run
hugo --templateMetricsto see which layout was chosen. - Inspect custom render hooks or shortcodes that may return
emptyornilvalues. - Verify that the theme’s
list.htmlorsingle.htmldoes not filter pages based on.Paramsor.Type.
Practical Verification
After applying a fix, run a dry build and compare the public/ tree to a previous successful build:
hugo --buildDrafts --buildFuture --buildExpired
# then use a diff tool
diff -r public/ previous-public/
Look for the missing file’s path. If it now appears, the issue is resolved.
Limitations & Notes
- Front‑matter date parsing is version‑dependent; older Hugo releases have different defaults for
expiryDatehandling. - Local
hugo server -Dcan mask draft omissions that only surface in CI builds. Always test CI commands locally. - Timezone mismatches between the host clock and the date fields can cause a page to appear yesterday and vanish today. Use UTC in front matter or set
timeZoneinconfig.toml. - When using JSON front matter, field names are case‑sensitive. A typo like
Draftwill be ignored.
Conclusion
Missing pages in a Hugo build are almost always intentional filtering. By following the ordered checks and applying the targeted fixes above, you can quickly determine whether a draft flag, date issue, ignore pattern, template problem, or output configuration is the culprit. If the page still fails to render correctly, use --templateMetrics and review custom hooks before escalating to theme support or the Hugo community.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.