For update all categories with attribute is_anchor to 1


require_once 'app/Mage.php';

ini_set('display_errors', 1);
ini_set('max_execution_time', 600);

$categories = Mage::getModel('catalog/category')->getCollection();

foreach ($categories as $cat){

   $_cat = Mage::getModel('catalog/category')->load($cat->getId());

   if ($_cat->getData('is_anchor') == 0){

   echo $_cat->getName().' '.$_cat->getData('is_anchor').'<br/>';

One thought on “Magento update all categories with attribute is_anchor to 1”

  1. I do agree with all of the concepts you have offered on your post.
    They’re very convincing and can definitely work. Nonetheless,
    the posts are very short for beginners. Could you please prolong them a bit from subsequent time?
    Thank you for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.