Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active April 25, 2022 10:05
Show Gist options
  • Save Auke1810/f6627c1534781375a072a79a2bde0dff to your computer and use it in GitHub Desktop.
Save Auke1810/f6627c1534781375a072a79a2bde0dff to your computer and use it in GitHub Desktop.
remove all html tags from the description tag
<?php
function alter_feed_item( $attributes, $feed_id, $product_id ) {
// Strip html from description attributes
// allow given tags with allowedTags
$allowedTags = "";
$attributes['description'] = strip_tags($attributes['description'], $allowedTags);
// IMPORTANT! Always return the $attributes
return $attributes;
}
add_filter( 'wppfm_feed_item_value', 'alter_feed_item', 10, 3 );
@Auke1810
Copy link
Author

Ok, this function is a WordPress filter for our Product feed manager plugin.
There is no other use for this little snippet as for our feed manager you find at https://www.wpmarketingrobot.com/

@alhakeem2001
Copy link

I am using WP with WooCommerce, all what I need is to delete those HTML tags on my product descriptions. I don't think I need to download and install that plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment