Remove Html tags in Magento

If you want to remove <br/> tags from product description page .

than Goto

/app/design/frontend/base/default/template/catalog/product/view/description.phtml

copy description file in you’re local theme (template).

app/design/frontend/default/<theme name>/template/catalog/product/view/description.phtml

open local folder description.phtml file and delete “nl2br” tag .

echo $this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($this-&gt;getProduct()->getDescription()), 'description')

After Remove nl2br tag . the code is

echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $this->getProduct()->getDescription(), 'description') 

If you want to remove html tag form other place than use this

strip_tags()          // for PHP

$this->stripTags // For Magento

Leave a Reply