You are here:  » Replace/Remove HTML in Titles and Descriptions?


Replace/Remove HTML in Titles and Descriptions?

Submitted by ItsDavid on Sat, 2015-11-28 17:26 in

David, How would i go about removing HTML from Titles and descriptions? I need it to remove HTML from both Data Feeds and API Modules pulling XML data from API URL. Not sure if they would need separate code but just thought i would mention it.

Thank You

Submitted by support on Mon, 2015-11-30 08:58

Hi David,

For imported feeds, use the Strip HTML filter, either globally or per feed as required.

For your API modules, wherever using a title or description field e.g.

  $row->description = $item["DESCRIPTION"];

...use PHP's strip_tags() function to do the same thing, e.g.

  $row->description = strip_tags($item["DESCRIPTION"]);

Cheers,
David.
--
PriceTapestry.com