Skip to content

Instantly share code, notes, and snippets.


Jonathan Sayag jonathansayag

  • SQLi
View GitHub Profile
jonathansayag / magento-delete-attribute-options.php
Last active Mar 28, 2019
Magento PHP script to delete all values of an attribute
View magento-delete-attribute-options.php
$attribute_code = 'ATTRIBUTE_NAME';
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', $attribute_code);
$options = $attribute->getSource()->getAllOptions();
$optionsDelete = array();
foreach($options as $option) {
if ($option['value'] != "") {
$optionsDelete['delete'][$option['value']] = true;
You can’t perform that action at this time.