Reply To: How to remove a shortcode from the homepage excerpts?

#2890
Ron
Keymaster

Hi Jenny

Try to add this on your functions.php (preferably on a child theme)

function modify_excerpt( $text ) {
	$text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text);
	return $text;
}
add_filter( 'the_excerpt', 'modify_excerpt' );