/** * Removes WPBakery tags [vc_row], [vc_column], etc. * and their CSS attributes from the front end. */ add_filter('the_content', function($content) { // This regex targets anything starting with [vc_ or [/vc_ and ending with ] $pattern = '/\[\/?vc_.*?\]/s'; return preg_replace($pattern, '', $content); }, 999);// Also apply to widgets in case the code is in a sidebar or footer add_filter('widget_text', function($content) { $pattern = '/\[\/?vc_.*?\]/s'; return preg_replace($pattern, '', $content); }, 999);