[ad_1]
Replies: 2
Hello,
I am trying to add a custom header using a filter from my child theme but it looks like the filter is not applied at all and redirection plugin directly handles the redirect.
The code I have is this:
function add_header_xrobots( $headers ) {
if( !( stristr( $_SERVER['REQUEST_URI'], '/ulos/' ) === false ) )
$headers['X-Robots-Tag'] = 'noindex, nofollow';
return $headers;
}
add_filter( 'wp_headers', 'add_header_xrobots', 10, 2 );
May I ask you to tell me if there is an easy way to manipulate/add custom headers from inside the theme with a code?
Thank you in advance!
Kind regards,
Ali Nebi
