Streaming live at 10am (PST)

Dynamicly add noindex/nofollow to specific CMS pages

This is how I’ve done it.

Create a ‘Switch’ custom field called ‘Hidden’ for the collection

And finally, insert this code in the section of the template of that collection

<script>
  var meta_robots_tag = document.createElement('meta');
  meta_robots_tag.name = "robots";
  meta_robots_tag.content = Hidden ? "noindex, nofollow" : "index";
  document.getElementsByTagName('head')[0].appendChild(meta_robots_tag);
</script>

image

Did you have any issue using this… I want to implement this in a site which has more than 2000 blog pages.