Content directories getting into site map

#1
<url>
<loc>http://localhost:1313/en-us.html</loc>
<priority>0</priority>
</url>

also this:

<url>
<loc>http://localhost:1313/tags.html</loc>
<priority>0</priority>
</url>

How do I prevent this? These are just blank pages with titles “Tags” and “En-uss” with some listed stuff from the en-us directory in content/

#2

If you don’t use tags you can disable generating them like explained here. Then they won’t appear in the site map as well.
I don’t know what kind of page the en-us.html one is, but you might want to disable its generation as well.
If disableKinds is too coarse (disables also other similar taxonomy / list pages you want to keep), maybe ignoring the specific file that generates it would help
If you still need help, please link to your website source code or a small example that reproduces your issue

#3

The site is not published yet.

I have:

disableKinds = ["tags", "section", "categories"]

but i still see this in my sitemap

<url>
<loc>http://localhost:1313/categories.html</loc>
<priority>0</priority>
</url>

and

<url>
<loc>http://localhost:1313/tags.html</loc>
<priority>0</priority>
</url>

by the way, i should have mentioned I have a custom sitemap.xml layout!

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xhtml="http://www.w3.org/1999/xhtml">
  {{ range .Data.Pages }}{{ if ne .Params.sitemap_exclude true }}
  <url>
    <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
    <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
    <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
    <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
    <xhtml:link
                rel="alternate"
                hreflang="{{ .Lang }}"
                href="{{ .Permalink }}"
                />{{ end }}
    <xhtml:link
                rel="alternate"
                hreflang="{{ .Lang }}"
                href="{{ .Permalink }}"
                />{{ end }}
  </url>
  {{ end }}{{ end }}
</urlset>
#4

If you do not want Hugo to create any taxonomies, set disableKinds in your site config to the following:

disableKinds = ["taxonomy", "taxonomyTerm"]

Categories and tags are just a type of taxonomies. They don’t belong to disableKinds

2 Likes
#5

You should make a small project and share the code for it. I can’t make sense of your sitemap, I’d have to build a site and add content to it, and I don’t know if you do something special, and I hope this all explains why we recommend share a repo, per Requesting Help. :slight_smile:

#6
disableKinds = ["taxonomy", "taxonomyTerm"]

With these options I am still seeing categories.html and tags.html in the generated public/ after running hugo

#7

Delete public manually, or run

hugo --cleanDestinationDir
2 Likes