The following example shows the shortcode within a blog post preview:
$content = get_the_content(); $content = preg_replace('#[[^]]+]#', '',$trimmed_content = wp_trim_words($content, 20)); echo apply_filters('the_content', $content, $trimmed_content);