If you aren’t using Google Fonts in Elementor then you don’t want them to load on your site. This slows things down and creates unnecessary bloat. A recent site I built was using TypeKit rather than Google Fonts and I had disabled the loading of Google Fonts in Elementor but it was still loading.
What happens here is if you accidentally use a widget in Elementor that has a Google Font already selected it is still going to load it. One solution is to dig through every single Elementor block and check if it uses Google Fonts. This is tedious work. Luckily there is an easier way to disable it.
// Disable Google Fonts in Elementor
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
Add the above code to your functions.php file and it should disable the loading of Google Fonts through Elementor even if you are using a block that calls for a Google Font.
thanks, just what i was lookin for.
Thank you very much, this trick is very handy 🙂
Thanks it works
Yes it worked for me too. Thanks. Couldnt find it on the plugin website.
Or can’t it be added to Elementor | Custom Code?
I remove all Google fonts with this code and it works
But how can I remove Google fonts in the dropdown list inside Elementor’s editor.
I load my fonts locally and don’t want my customer to think they can choose any Google font from this dropdown (both because of GDPR and because it will ruin the overall look of the site.