开发者

noindex no follow variable- have I done this correct?

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开发者_JAVA技巧 want indexing have index, follow and pages i dont want have noindex, nofollow.

Can anyone help?


Look at Google's Webmaster Blog for that particular subject - you should omit the meta tag when your $robots variable contains "on".

Furthermore, using the blog and webmaster central would be a smarter and more efficient way to actually determine if your site is indexed and help improving your understanding in SEO.


If you're 100% sure that your code is in order, sign up your site at Google Webmaster Central to get real-time data about how Google crawls your site, and possible errors.

If Google is just not dropping by to crawl your site, consider submitting a XML sitemap - it sometimes seems to me this makes the next crawl happen sooner. (I have no hard data on that, though.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜