Skip to content

Instantly share code, notes, and snippets.

@yireo
Created February 12, 2013 10:53
Show Gist options
  • Save yireo/4761542 to your computer and use it in GitHub Desktop.
Save yireo/4761542 to your computer and use it in GitHub Desktop.
Magento XML-layout update to set NOINDEX,FOLLOW tag on Layered Navigation pages (kudos @hans2103)
<layout>
<catalog_category_layered>
<reference name="head">
<action method="setRobots"><meta>NOINDEX,FOLLOW</meta></action>
</reference>
</catalog_category_layered>
<catalog_category_layered_nochildren>
<reference name="head">
<action method="setRobots"><meta>NOINDEX,FOLLOW</meta></action>
</reference>
</catalog_category_layered_nochildren>
</layout>
@hans2103
Copy link

hans2103 commented May 6, 2013

You can use this code in the local.xml of your own theme.
Learn how to create themes. More information see my presentation held on the Dutch edition of Meet Magento: http://www.slideshare.net/hans2103/magento-theme-set-the-basics-right-mm12nl

@yireo
Copy link
Author

yireo commented May 6, 2013

The Gist is actually all you need to copy and paste the right code. The filename is "local.xml" and the code is there. Note that we do NOT recommend you to make any changes to your Magento XML-layouts without having the right knowledge. Any change might destroy your site. Make sure you fully understand the fundaments of XML-layouts before using this code. The official Magento site has numerous guides that you should read inside-out before starting with hacking your own code.

The usage of robots.txt is not related to this Gist. If you want to know more about the benefits of a robots-file, it is best to ask around on the official Magento Forums. This page is only ment to discuss the specific code of this Gist. It is not ment to give additional support on Magento.

@rdalmagro
Copy link

Thanks in advance, I really appreciate it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment