# Missing tags

**URL:** <https://discourse.gohugo.io/t/missing-tags/44221>\
**Category:** support\
**Tags:** taxonomy\
**Created:** [May 5, 2023, 3:09pm UTC](https://discourse.gohugo.io/t/missing-tags/44221 "2023-05-05T15:09:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anmith](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@anmith](https://discourse.gohugo.io/u/anmith)\
**Post date:** [May 5, 2023, 3:09pm UTC](https://discourse.gohugo.io/t/missing-tags/44221/1 "2023-05-05T15:09:38Z")

</div>

Hi,

I thought creating a tag list is done in a few minutes, but right now I’m trying to find out why some tags are missing.

My code is:

```auto
{{ $count := 0 }}
<ul>
{{- range $name, $taxonomy := .Site.Taxonomies.tag }}
	<li>{{ $name }} ({{ .Count }})</li>
	{{ $count = add $count 1 }}
{{ end }}
</ul>
Number of tags: {{ $count }}

```

The code is placed in a shortcode and should display a list of the tags used on the site.

Output of the script is

> Number of tags: 666

but when I look at the “public/tag” directory, I see 672 folders. Doing some manual comparison, I found that eg. “public/tag/w.a.s.p.” is indeed created as folder (and accessible from the browser), links to 4 pages but is missing in the list created by the code shown above.

Does anybody have a hint what’s going wrong?

---

<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:** [May 5, 2023, 7:41pm UTC](https://discourse.gohugo.io/t/missing-tags/44221/2 "2023-05-05T19:41:20Z")

</div>

You are running into this bug:  
[https://github.com/gohugoio/hugo/issues/10475](https://github.com/gohugoio/hugo/issues/10475)

You can work around it…

content/posts/post-1.md

```plaintext
+++
title = 'Post 1'
tag = ['wasp'] # no periods
+++

```

Then create the term page:

```plaintext
hugo new tag/wasp/_index.md

```

content/tag/wasp/\_index.md

```plaintext
+++
title = 'w.a.s.p.'
+++

```

Then use the term page `.LinkTitle` instead of the term name:

```plaintext
{{ $count := 0 }}
<ul>
  {{- range $name, $taxonomy := .Site.Taxonomies.tag }}
    <li>{{ .Page.LinkTitle}} ({{ .Count }})</li>
    {{ $count = add $count 1 }}
  {{ end }}
</ul>
Number of tags: {{ $count }}

```

---

<div class="post-metadata">

**Author:** ![anmith](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@anmith](https://discourse.gohugo.io/u/anmith)\
**Post date:** [May 5, 2023, 8:49pm UTC](https://discourse.gohugo.io/t/missing-tags/44221/3 "2023-05-05T20:49:44Z")

</div>

Thanks for pointing me to the issue, seems I can stop wondering what I’m doing wrong. 😃

Also thanks for the workaround, much appeciated!

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [May 7, 2023, 8:50pm UTC](https://discourse.gohugo.io/t/missing-tags/44221/4 "2023-05-07T20:50:24Z")

</div>

Closed on May 7, 2023, 8:50pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
