Add No Index meta tags to author pages

#1

I want to add <meta name=“robots” content=“noindex”> into the head tag of all the /tag & /author URLs
I tried to add meta tags in author.hbs file in my theme but tag was under body tags.

#2

I think the {{block}} and {{contentFor}} features of Handlebars will help here, you can see how it’s used in Casper with the footer scripts.

In your case you can add a {{{block "header"}}} statement before the </head> in default.hbs then in your author.hbs file you can add this anywhere in the file:

{{#contentFor "header"}}
<meta name="robots" content="noindex">
{{/contentFor}}
1 Like
closed #3

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