Quickly remove WP Bakery (Visual Composer) code from loading on your posts

91
black woman shiv scripts and styles with sword

Thousands of websites use WP Bakery (Visual composer). Most of them use it only on pages, but not on posts. There is an easy way to remove WP Bakery styles and scripts loading on your posts. Add this code to your functions.php:

/* remove wp bakery scripts and styles from posts */
function dequeue_visual_composer_css() {
if (is_single()) {
wp_dequeue_style('js_composer_front');
wp_dequeue_style('td-vc-composer-css-shim');
}
}
add_action('wp_enqueue_scripts', 'dequeue_visual_composer_css', 1003);

Done! Thanks for reading.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

CAPTCHA