Skip to content

Instantly share code, notes, and snippets.

@deeman
Created June 3, 2019 10:37
Show Gist options
  • Select an option

  • Save deeman/44b9212310d6535fc2226a136c70d73f to your computer and use it in GitHub Desktop.

Select an option

Save deeman/44b9212310d6535fc2226a136c70d73f to your computer and use it in GitHub Desktop.
Elementor - Disable external scripts
//# Removing external scripts in Elementor #//
// For Google Fonts:
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
// For Font Awesome Icons:
// Also works on none Elementor-pages
add_action( 'wp_enqueue_scripts', function() { wp_dequeue_style( 'font-awesome' ); }, 50 );
// To remove the Font Awesome http request as well:
add_action( 'elementor/frontend/after_enqueue_styles', function () { wp_dequeue_style( 'font-awesome' ); } );
// For Eicons:
add_action( 'elementor/frontend/after_enqueue_styles', function() { wp_dequeue_style( 'elementor-icons' ); } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment