Snippets

Visser Labs Remove Shortcodes and Visual Composer markup from Description field in Product exports

Created by Michael Visser last modified
function custom_woo_ce_extend_product_item( $product, $product_id ) {

	// Remove WordPress shortcodes from Description
	$product->description = strip_shortcodes( $product->description );
	// Remove Visual Composer markup from Description
	$product->description = preg_replace("~(?:\[/?)[^/\]]+/?\]~s", '', $product->description );

	return $product;

}
add_filter( 'woo_ce_product_item', 'custom_woo_ce_extend_product_item', 10, 2 );

Comments (0)