#2 Jun 14, 2005 00:37
There are probably cleaner ways to implement this... a more b2evolution-oriented way.
Yep, it sure can.
I've approached the problem in a slightly different way: my goal is to only index non-changing content. So, I don't want to index the main page, but archives (monthly, etc.) can be indexed (since they don't change.)
While there will be some overlap (the yearly archive contains the monthly archive, etc.), this ensures that there aren't any cases where the search engine indexes something that then goes away. (I always feel bad when I see search hits that go to the main page where someone was searching for something that I blogged about last year.)
<meta name="robots" content="<?php if( $m || $w >= 0 && !isempty($w) || $disp=='single' ) echo 'all'; else echo 'noindex, follow'; ?>" />
If it's an archive page ($m and/or $w aren't empty) or a permalink ($disp is 'single') then set the robots meta to ALL (which is the same as "index,follow".) Otherwise, don't index the page, but do follow the links.