Audit Every Hugo Post with hugo list all
You will finish with a repeatable inventory of every post in a Hugo content directory, including drafts, scheduled future pages and expired pages. This guide uses the locally installed Hugo 0.123.7+extended package. Allow about ten minutes if your site and source path are already known.
The route
Jump straight to the step you need, or tick off Done means at the end.
You need a shell, a Hugo project, and read access to its source directory. The command is an inspection tool. It does not publish a page, change front matter or remove content. It can still read the project's configuration and related theme or module paths, so run it against a directory you trust.
1. Confirm the Hugo version and command
Check the binary before relying on examples. Version-specific details matter because Hugo's command flags can change between releases:
$ hugo version
$ hugo list all --help
On this machine, the first command reports hugo v0.123.7+extended. The second describes hugo list all [flags] [args] and shows that this subcommand has no content-selection flag of its own. The useful distinction is built into all: it includes draft, future and expired pages as well as ordinary posts.
Checkpoint
If hugo is not found, stop here and install Hugo through your normal system process. Do not substitute a similarly named wrapper without checking its documentation.
2. List every post from an explicit project path
Pass the Hugo project directory with --source. Replace the placeholder with the directory that contains the site's configuration and content:
$ hugo list all --source /path/to/example-site
Hugo reads the content directory relative to that source path and prints its inventory to the terminal. The exact rows depend on the project's content and front matter. A successful run gives you a list you can review for pages that would normally be hidden from a normal build, such as an unfinished draft or a page dated in the future.
Do not confuse the command with hugo list or a normal site build. The purpose of this subcommand is the complete content audit. It does not mean every listed page is ready to publish; it deliberately includes pages that are not currently published.
3. Save an audit without losing the terminal result
Redirect standard output to a file when you need to compare the inventory or attach it to a review. Use a clearly named path outside the site unless you intentionally want the report tracked with the project:
$ hugo list all --source /path/to/example-site > /tmp/example-site-content-list.txt
$ sed -n '1,20p' /tmp/example-site-content-list.txt
The first command overwrites that temporary report if it already exists. This is not a Hugo content change, but it is still an irreversible shell redirection for that report. Choose a new filename if the old audit matters. To keep progress messages visible while saving output, use your shell's tee command instead:
$ hugo list all --source /path/to/example-site | tee /tmp/example-site-content-list.txt
Checkpoint
Inspect the saved file before treating it as evidence. An empty or unexpectedly short result can indicate the wrong source directory rather than an empty site.
4. Make the source and environment explicit when needed
Hugo uses its project configuration by default. If the project has several configuration files or environments, select the intended inputs rather than relying on whichever directory happens to be current:
$ hugo list all \
--source /path/to/example-site \
--config /path/to/example-site/hugo.yaml \
--environment staging
The installed command also accepts --configDir for a configuration directory, --themesDir for themes, and --clock for a supplied time such as 2021-11-06T22:30:00.00+09:00. These inputs can affect date-sensitive content, so record them with an audit if reproducibility matters. Use --quiet when you need less diagnostic output, or --verbose and --debug while investigating a failure. --logLevel accepts debug, info, warn or error.
Do not add flags merely because they exist. In particular, --destination is an inherited filesystem path option, but listing content does not require a destination. Keeping the command small makes it easier to see which source and date assumptions produced the report.
5. Diagnose the common wrong-result cases
If the command fails, first run it again with --verbose and check the source path. A path containing a site but not its intended configuration can produce an inventory that does not match your expectation. Then confirm the configuration filename and environment before changing content.
If a draft, future page or expired page is missing, check that you used hugo list all, not a narrower listing command. Also check the page's front matter and date against the clock used for the audit. A future page remains future relative to that clock; changing the clock changes the classification, not the page itself.
If you need to publish or suppress a page after the audit, stop and review the project's normal release workflow. This command does not provide an enable, delete or edit operation. Make any front matter change separately, review the resulting diff, and retain the original value so you can undo it if the decision was wrong.
Done means
hugo versionidentified the binary you used.hugo list all --source /path/to/example-sitecompleted against the intended project.- Your review included drafts, future pages and expired pages, not only currently published content.
- Any saved report records its source path and relevant configuration or clock assumptions.