Remove unused styles from wordpress
I guess, because you pass 1) wrong handler, 2) wrong hook
- Handler is not id - WP automatically adds -css and -js, so in your case handler should be wc-block-vendors-style (id-attribute minus '-css')
- Hook to enqueue/dequeue assets is wp_enqueue_scripts. According to https://developer.wordpress.org/reference/functions/wp_dequeue_style/ good way to deregister is to add a priority is higher than 10
function remove_assets() {
wp_dequeue_style('wc-block-vendors-style');
}
add_action( 'wp_enqueue_scripts', 'remove_assets', 11);