function diwp_remove_shortcode_from_excerpt($content) { $content = strip_shortcodes( $content ); return $content; } add_filter('the_excerpt', 'diwp_remove_shortcode_from_excerpt');