

This code ensures that your archive and search pages don't get indexed and therefore won't cause duplicate content headaches. However, any links on these pages are followed, so these pages can pass on any link juice to the rest of the site.
If someone links to your archive page, that page receives a certain amount of PageRank (link juice). We don't want that page to compete for rankings with our posts, but we do want it to be able to pass along any of that link juice to the posts. Using noindex, follow on these archive and search pages takes care of both issues.
<?php
if(!is_archive() && !is_search()){
?>
<META NAME="robots" CONTENT="ALL" />
<?php
}else{
?>
<META NAME="robots" CONTENT="NOINDEX, FOLLOW" />
<?php
}
?>