Block Page & Category Spidering in Wordpress

June 25, 2009 in Code Library | Comments (0)

To block page and category spidering by polite search engines, you use the following code in your header.php template:


if((is_home() && ($paged < 2 )) || is_single() || is_page() || is_category()){
echo '<meta name="robots" content="index,follow" />';
} else {
echo '<meta name="robots" content="noindex,follow" />';}

The point of this is to prevent duplicate content in wordpress.

If you would like An Expert Marketer in Phoenix/Mesa to do this kind of work, or other Wordpress SEO / Marketing for you, please contact me.