Nathan
Nathan

Reputation: 7855

How to write a SQL query to remove html links in Magento description?

I have thousands of products that include the following in the longDescription field:

<ul>
<li>Some content</li>
<li><a href="link"... </li>
</ul>

Several trailing line breaks...

I'm wondering if there is a safe and effective SQL query that can remove the <li>'s with the links in them, as well as the trailing line breaks / empty characters?

Upvotes: 0

Views: 324

Answers (1)

Thomas M&#252;ller
Thomas M&#252;ller

Reputation: 1433

Best way might be to add a frontend model to the attribute. Create a model that extends Mage_Eav_Model_Entity_Attribute_Frontend_Abstract and remove the HTML in the getValue() function e.g. using strip_tags().

Upvotes: 1

Related Questions