For GDPR reasons I’ve hosted Open Sans locally on my server but somewhere/somehow opensanshebrew and opensanshebrewcondensed are still requested from google-earlyaccess-1, google-earlyaccess-2 and google-earlyaccess-3
I’ve gone through all my pages and I’m not using this font anywhere. I want to disable this in my functions.php and I’ve tried the following code
>function remove_hebrewfont(){
>wp_dequeue_style( ‘google-earlyaccess-1’ );
>wp_dequeue_style( ‘google-earlyaccess-2’ );
>wp_dequeue_style( ‘google-earlyaccess-3’ );
>}
>add_action( ‘wp_enqueue_scripts’, ‘remove_hebrewfont’, 100 );
But sadly the font is still being requested from google and in breach of the GDPR. A local lawyer has started sending out cease and desist letters asking for 190 EUR as compensation – I haven’t received one yet but it’s becoming a big deal in austria/germany.
How can I get rid of these requests?
‘m using WP 6.0.1, OceanWP 3.3.4 and Elementor 3.7.2
[ad_2]
Are you sure you’ve got the correct handles? ie google-earlyaccess-1, google-earlyaccess-2, google-earlyaccess-3
Also a quick google search tells us this is a known quirk, eg [https://wordpress.stackexchange.com/questions/202888/wp-dequeue-style-not-working])
[https://stackoverflow.com/questions/45547054/wp-dequeue-style-not-seems-to-working])
Basically they try to also add wp_deregister_style() so you could try reading those and trying their solution on your own site.
Hope that helps!
Unless you ask to load the font in Elementor and/or Ocean – it should not load.
It also doesn’t need to be enqueued. So ‘dequeue’ probably won’t do anything.
All it takes to add the font is a simple style tag. This can be added by:
Your theme through its OPTIONS or the CUSTOMISER
Elementor via one of it’s fun and trashy methods (check their docs)
Via custom CSS in a child theme
Via custom function in child theme
Via custom css in CUSTOMISER (or in your theme / via a plugin)
Via a function/style from a plugin – so you may have a plugin pulling this font – not you or your theme at all.
I would migrate it all to a staging site – or use wp-safe-mode. Visit the site (as logged in) and right-click INSPECT the page – find the <style> tag which is calling the font. Disable all your plugins (in another window). Refresh the page – see if the <style> tag has gone. If so, enable one at a time until you find the culprit.
You can disable elementor / and switch to a default theme to see if they are doing it. I use google fonts a lot and have never encountered this issue – so something is custom on your site and needs to be fixed.
It’s also worth knowing that if you put a line in your privacy/cookies policy saying you use google fonts, and linking to the google privacy policy – you are complaint. You can’t be sued for using google fonts – but unscrupulous lawyers will try and make you think you can. GDPR states TRANSPARENCY in what you do, not that you can’t do it.