Add No Index meta tags to author pages

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.

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}}
2 Likes

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