Noindex taxonomy paginated pages

Hi

I am using this code to noindex my paginated pages. even they are on homepage or on taxonomy pages or category pages, but this code doesn’t work!
Please give me the solution!

{{- if eq .RelPermalink "/" -}}
  {{- if ne .Paginator.PageNumber 1 -}} 
    <meta name="robots" content="noindex, follow">
  {{- end -}}
{{- else }}
  <meta name="robots" content="index,follow" />
  <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
  <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
{{- end -}}

layouts/_default/baseof.html

{{ $robots := `
  <meta name="robots" content="index,follow">
  <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
  <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
`}}

{{ with .Paginator }}
  {{ if ne .PageNumber 1 }}
    {{ $robots = `<meta name="robots" content="noindex, follow">` }}
  {{ end }}
{{ end }}

{{ $robots | safeHTML }}

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