Support » Fixing WordPress » Disallowing Archive Folders which method is best?

  • I want to disallow the robots to my archive folders (/2007/) but not my category folders.

    I tried to do this with my robots.txt file but it doesn’t work when I checked it on Webmaster Central:
    # WordPress
    User-agent: Googlebot
    Disallow: /2006/
    Disallow: /2007/

    So then I placed this code in my header.php file but it not only disallows the bots from the archive but the categories as well.

    <?php if (is_archive()){
    echo “<meta name=\”robots\” content=\”noindex,follow\”>\n”;}

    Any ideas?

  • The topic ‘Disallowing Archive Folders which method is best?’ is closed to new replies.