Normally, if you retrieve the excerpt using the get_the_excerpt() function, the plugin itself will automatically remove [raw] blocks from the excerpt. Are you using a different approach to generate the excerpt?
Thread Starter
rozv
(@rozv)
thanks for the quick reply. yes i am using a different way of generating the excerpt with a custom function
/* Function -- Get excerpt by post id */
function get_excerpt_by_ID($post_id){
$the_post = get_post($post_id); //Gets post ID
$the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt
$excerpt_length = 35; //Sets excerpt length by word count
$the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); //Strips tags and images
$words = explode(' ', $the_excerpt, $excerpt_length + 1);
if(count($words) > $excerpt_length) :
array_pop($words);
array_push($words, '…');
$the_excerpt = implode(' ', $words);
endif;
$the_excerpt = '<p>' . $the_excerpt . '</p>';
return $the_excerpt;
}
If possible, try running the result through the get_the_excerpt filter. Something like this:
$the_excerpt = apply_filters('get_the_excerpt', $the_excerpt, $the_post)