Tagged: noindex
Hi,
i use Woocomerce for my enfold-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 tryed 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
Chris
Hey Chris_85!
Thank you for using Enfold.
The purpose of noindex is to prevent crawlers from finding the page. Instead of setting the meta tag to noindex, set a parameter exclusion in the robot.txt file. http://stackoverflow.com/questions/9149782/ignore-urls-in-robot-txt-with-specific-parameters
Regards,
Ismael