I use Woocomerce for my WordPress site. For the print version of some sites I use a parameter like this http://www.mywebsite.de/kategorie/?wpp_export=print
How can i set these urls to noindex
. I tried a code like this in the header.php:
<?php
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,'?') !== false) {
echo '<meta name="robots" content="noindex, follow" />' . "\n";
}
?>
But the code did not work. There is no noindex
in the head of these sites…
Could you help me with this?
Best regards
Tom