Change meta data if tags listing

I am sorry if this is obvious, I have been trying to search for this, but I am probably searching wrong, and Hugo is still very new to me.

I have a site, and I use the 2 default taxonomies: tags and categories.

But, trying to make my site SEO friendly, I end up with 2 options as I see it (Where I would like to use both)

For the Tags listings (e.g. www.example/tags - www.example.com/tags/cars) I dont want google to index, as I have read that is bad for SEO, so I want to change my meta tag from index, to noindex,
but how?
The results I have found for this, is creating custom content for each tag e.g. /content/tags/cars/_index - /content/tags/bikes/_index

But surely, that can’t be right… right?? that would mean a whole lot of manual “labor”.

The other case is the categories, here I understand that you do want to index those, so here I need to have a custom discription for each category, can that be done in front matter, or would this also need to be done with custom/category/food/_index

Hope someone can shed some lights on this

In my perspective I think it’s not bad at all to let Google index your tag or category pages, especially if you have something bold like unique meta and another SEO stuff.

I’m not sure if there is better workaround but in my case I’m using .Scratch in my tags template (layouts/tags/taxonomy.html) and then using conditional logic in meta template

for example

{{ if $.Scratch.Get "tags" }}
     <meta name="robots" content="noindex, follow" />
{{ end }}

the alternative and the easier way is to prevent Google crawl the tags pages via robots.txt,

Note: you have to make sure that the tags pages not appears in your sitemap

About front matter maybe you can found the answer here

1 Like

Thank you for the prompt reply, and sorry for the slow answer :slight_smile:
I will read it again (Had found it in my search, but since it was a year old, I was hoping an easier solution would be available )