I want to strip just the [gallery] shortcodes in my blog posts. The only solution I found is a filter that I added to my functions.
function remove_gallery($content) {
if ( is_single() ) {
$content = strip_shortcodes( $content );
}
return $content;
}
add_filter('the_content', 'remove_gallery');
It removes all shortcodes including [caption] which I need for images. How can I specify a single shortcode to exclude or include?