Last active
April 25, 2022 10:05
-
-
Save Auke1810/f6627c1534781375a072a79a2bde0dff to your computer and use it in GitHub Desktop.
remove all html tags from the description tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
Hello @alhakeem2001, you add this code to your functions.php
Our plugin has a new function where you click the "edit values" link and select strip tags from the dropdown.
This will remove all HTML
Thanks Auke for your reply but what is the name of your plugin? because I couldn't find it when I wanted to add it!
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/
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
Hello , where to add this code in order to remove all HTML codes from my product description?