All of the product category pages in our store are two column (nav left) format. One of our categories needs to have an element in the left hand column removed. Every single other page that has this left-hand column has this element in it, and needs to continue to do so, but for these few minor subcategories.

The previous developer had it set up so that the element was in a banner, and positioned with a widget via the CMS. It's set up to show up on a ton of different pages (eg: Categories is set to All), and we want to keep it like that so that we don't have to add new categories to a specific list as new ones are made by product managers and whatnot.

I couldn't find a way to remove banners nor widgets from a specific category, so I recreated the banner as a static block, intending to use the Custom Layout Update to remove it by its name.

<reference name="left">
<remove name="my_static_block_id"></remove>

This does not work!

I also tried unsetChildren:

<action method="unsetChildren"/>

This removed everything from the left column (not desirable)

Is there some way to do this? Perhaps somewhere I did not look? Thank you.

  • Can you also add in the XML you used to add in the CMS block to begin with. I suspect your name="" is the block_id rather than the XML name. Jan 14, 2015 at 22:13
  • I am not using XML to add the CMS block. It is 100% using the CMS to add the static block through a widget (which you can use to position your static blocks). I will edit my question to say 'id' instead; it is when I use the static block ID that it does not work at this point in time.
    – G. Curry
    Jan 15, 2015 at 15:36

2 Answers 2


So what your trying to achieve is difficult because of the way widgets are added to the page, when a widget is saved it's layout XML update is automatically generated HOWEVER the name that is generated is just an random hash generated in the file below.


$hash = Mage::helper('core')->uniqHash();
$xml .= '<block type="' . $this->getType() . '" name="' . $hash . '"' . $template . '>';

This is then later saved to the database for example in my case the random name was 9d10a0d6931d18586a907b201633d878 which you can see is in the below image.

enter image description here

So although it's probably not very practical to do so in theory there is a way you could do this without touching any code you could create the widget search for the update record in the database table core_layout_update get your new block name and then do for example <remove name="9d10a0d6931d18586a907b201633d878"/> However if you make any change to the widget the XML and name will refresh and you would need to update the name references once again. I tried unsetChild and that didn't seem to work I suspect that is due to the order in which the XML is processed for widgets.

I think you have two real options:

1) Add a new text_list to the left column, right column or anywhere else you would want to add widgets and then mabey remove them on a page. You can do this in your themes local.xml like this.

    <reference name="left">
<block type="core/text_list" name="widgets_left" as="widgets_left" translate="label">
                        <label>Widgets Left</label>

This will add a new option in the backend as in the image which you can then add widget instances too or just remove if you need to by name as you have the widgets_left name as a reference.

e.g enter image description here

You can then do either on the below in the specific category you'd like them removed from:

<reference name="left">
<action method="unsetChild"><name>widgets_left</name></action>

<remove name="widgets_left"/>

2) Alternatively you could just add them in Via XML like below, but it sounds to me like you want as much control as possible via the CMS and why not for me widgets are underused.

<reference name="left">
            <block type="cms/block" name="cms_left_block_name">
                <action method="setBlockId"><block_id>my_block_identifier_from_magento_backend</block_id></action>

You will then have a reference fixed as "cms_left_block_name" which you can use to either perform a remove or unsetChild.

  • I think you are correct that these are my only real options. I suppose I can add this to my long wish list of things I would like Magento to do easily for me! Thank you for your detailed response.
    – G. Curry
    Jan 26, 2015 at 15:37

You're close, you need to know the NAME of the block added, and the name of it's parent.

For example, a block added to the parent block "left" as follows:

<reference name="left">
    <block type="cms/block" name="my_block_name">
         <action method="setBlockId"><block_id>some_static_block_identifier</block_id></action>

Would be removed as follows:

<reference name="left">
    <action method="unsetChild"><child>my_block_name</child></action>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.