Cannot dequeue Elementor Font Awesome css

I am using the same below code to dequeue many other styles but it is not working for Elementor, and a couple of others.

function enqueue_content(){
  wp_dequeue_style( 'elementor-icons-shared-0' );
  wp_dequeue_style( 'elementor-icons-fa-solid' );
  wp_dequeue_style( 'elementor-icons-fa-regular' );
add_action('wp_enqueue_scripts', 'enqueue_content', 20);

I have also tried the method described on their support: https://docs.elementor.com/article/286-speed-up-a-slow-site

EDIT: It seems as if the styles I can't dequeue are loading from a different, parent wp-content folder (it is a multisite).

Topic php css Wordpress

Category Web


I ran into the same issue. This snippet worked for me.

add_action('elementor/frontend/after_register_styles',function() {
    foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
        wp_deregister_style( 'elementor-icons-fa-' . $style );
    }
}, 20 );

You may only need the solid and regular dequeued.

add_action('elementor/frontend/after_register_styles',function() {
    foreach( [ 'solid', 'regular' ] as $style ) {
        wp_deregister_style( 'elementor-icons-fa-' . $style );
    }
}, 20 );

Elementor Reference

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.