Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save breakerh/f2406858f896d1e8682c9f49ab989c08 to your computer and use it in GitHub Desktop.
Save breakerh/f2406858f896d1e8682c9f49ab989c08 to your computer and use it in GitHub Desktop.
Elementor Remove Font Awesome; if you have inline icons experiment enabled you wont need to remove Font Awesome, * it will only load the icons that are used.
/**
* https://docs.elementor.com/article/286-speed-up-a-slow-site
*
* Read me first: if you have inline icons experiment enabled you wont need to remove Font Awesome,
* it will only load the icons that are used.
*
* Note: By default, Font Awesome icons will only load on the pages where you've used them, so FA won't load on pages that aren't using any Font Awesome icons.
* This brings faster performance and faster page speed to your site, which can benefit your SEO and your users' experience.
* Only the CSS and fonts of the icon family you actually use are loaded. So only dequeue Font Awesome if you truly plan to not use any Font Awesome icons at all.
* If you dequeue Font Awesome, the icons will no longer show on any of your pages
*
*/
add_action( 'elementor/frontend/after_register_styles',function() {
foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
wp_deregister_style( 'elementor-icons-fa-' . $style );
}
}, 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment