Display cleaner excerpts – get rid of all shortcodes in excerpts

If you want to simply get rid of all shortcodes in excerpts, try this:

add_filter('pre_excerpt_content', 'shortcodes_trim');
function shortcodes_trim($content) {
	$content = preg_replace('/\[.*?\]/s', '', $content);
	return $content;

For Divi Page Builder, use this:

add_filter('pre_excerpt_content', 'trim_divi_shortcodes');
function trim_divi_shortcodes($content) {
    $content = preg_replace('/\[\/?et_pb.*?\]/', '', $content);
    return $content;

For Visual Composer, use this:

add_filter('pre_excerpt_content', 'trim_vc_shortcodes');
function trim_vc_shortcodes($content) {
    $content = preg_replace('/\[\/?vc.*?\]/', '', $content);
    $content = preg_replace('/\[\/?mk.*?\]/', '', $content);
    return $content;

Deregister script and css file that is registered by Visual Composer from a theme

An example how to deactivate the whole Flexslider, Nivoslider and Owl Carousel sliders in the Visual Composer plugin.

add_action( 'wp_enqueue_scripts', 'remove_vc_modules', 99 );
function remove_vc_modules() {
	wp_deregister_style( 'flexslider' );
	wp_deregister_script( 'flexslider' );

	wp_deregister_style( 'nivo-slider-css' );
	wp_deregister_style( 'nivo-slider-theme' );
	wp_deregister_script( 'nivo-slider' );

	wp_deregister_style( 'owl-carousel' );
	wp_deregister_script( 'owl-carousel' );