I want to change the meta robots tag value from index,follow to noindex,nofollow to all category filter pages only. How can I achieve this?
I am trying to do this by jquery below-
<script type="text/javascript">
var getCurrentUrl = window.location.href;
if(getCurrentUrl.includes("?")){
document.getElementsByTagName('meta')["robots"].content="INDEX,NOFOLLOW" ;
}
</script>
But it's not updating the value of current meta robots tag.