Robots "noindex" for archives_month and tag: URLs

Good morning everyone,

is it possible to put a “noindex” to all archive pages (archives_month) and tag:* URLs?

I know that I can set the robots tag in the backend for pages but do not see a option for generated archives and tag URL.

Maybe something like this in the base.html.twig

<meta name="robots" content="whatever I set in the backend" & "for URLs that contain "archives_month" or "tag:" use "noindex, follow" />

Is it possible to do this?

Thanks!

Found the solution here:

add this in base.html.twig

{% if uri.params is not empty -%}
<meta name="robots" content="noindex">
{% endif %}
2 Likes

Since you’re interested in the tag URL parameter specifically, I would test for that as well.