Created
February 25, 2015 09:17
-
-
Save markvds/26f57919e5e13a4898b7 to your computer and use it in GitHub Desktop.
Magento shell script (place it in /shell) to output all filterable attributes. You can then copy/paste it into robots.txt to effectively stop bots from indexing your layered navigation. See also https://www.byte.nl/blog/zoekmachine-bots-en-serverbelasting/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'abstract.php'; | |
class Mage_Shell_Filterable_Attributes extends Mage_Shell_Abstract | |
{ | |
/** | |
* Run script | |
* | |
*/ | |
public function run() | |
{ | |
$attributes = Mage::getResourceModel('catalog/product_attribute_collection') | |
->addIsFilterableFilter(); | |
foreach ($attributes as $attribute) { | |
echo 'Disallow: /*?' . $attribute->getAttributeCode() . "=*\n"; | |
echo 'Disallow: /*&' . $attribute->getAttributeCode() . "=*\n"; | |
} | |
} | |
} | |
$shell = new Mage_Shell_Filterable_Attributes(); | |
$shell->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the Google Webmaster Tools parameters I can tell Google what the meaning of each and every parameter is. But ... life if bigger then only Google. Bing, Yandex and other search engines are not aware of Google Webmaster Tools parameters. Therefor this script is useful.