Skip to content

Instantly share code, notes, and snippets.

@indrisepos
Created May 28, 2015 21:40
Show Gist options
  • Select an option

  • Save indrisepos/8e9f4db8b819000700e0 to your computer and use it in GitHub Desktop.

Select an option

Save indrisepos/8e9f4db8b819000700e0 to your computer and use it in GitHub Desktop.
Remove Magento attribute
<?php
error_reporting(E_ALL | E_STRICT);
require_once './app/Mage.php';
umask(0);
Mage::app();
$attr = 'product_type'; //attribute code to remove
$setup = Mage::getResourceModel('catalog/setup', 'core_setup');
try {
$setup->startSetup();
$setup->removeAttribute('catalog_product', $attr);
$setup->endSetup();
echo $attr . " attribute is removed";
} catch (Mage_Core_Exception $e) {
print_r($e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment