0

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).

2
  • 1
    Have you tried increasing '20' to something like '100'? Also, consider installing the Debug Bar plugin(s) developer.wordpress.org/plugins/developer-tools/… They may be able to show you what priority the enqueue styles currently have. May 19, 2020 at 9:00
  • I have tried increasing the number. Unfortunately it's a site where I have no access to plugins. Have just realised it's a multisite and loading from two different wp-content folders. Edited question.
    – flinch85
    May 19, 2020 at 9:13

1 Answer 1

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.