Associative array of directives. Every key must be the name of the directive, and the corresponding value must either be a string to provide as value for the directive or a boolean true if it is a boolean directive, i.e. without a value.
To affect pages with a certain page template, you can add this directly to the template, as long as it’s above the call to wp_header().
To have more granular control over what pages are affected, you can add the snippet to your functions.php file and work with the current page inside the function:
Example of adding a noindex robots tag.
To affect pages with a certain page template, you can add this directly to the template, as long as it’s above the call to
wp_header().To have more granular control over what pages are affected, you can add the snippet to your functions.php file and work with the current page inside the function: