I have this script in the head of all my pages- which in an include:
<?php
if (isset($robots) && $robots == "off") {
$robots = '<meta name="robots" content="noindex,nofollow">';
print $robots."\n";
} else {
$robots = '<meta name="robots" content="index,follow">';
print $robots."\n";
}
?>
After the head is loaded the rest of the page loads and a variable is set.
$robots="off"; or $robots="";
I cannot get a single page to index in google. I am wondering if this is actually broken and all pages are being set to noindex, nofollow. If i view the source everything looks fine. eg pages I want indexing have index, follow and pages i dont want have noindex, nofollow.
Can anyone help?