I'm having an issue getting one of the google fonts to dequeue on my site https://subscriptionboxes.co.nz

I've done all the reading, and I can see it needs to be dequeued after its been called, but before its been printed, but I cant figure out how to find that info?
I also cant work out which plugin is making the call?

This is the code I have put in my child functions.php

function remove_google_fonts_stylesheet() { 
    wp_dequeue_style( 'googleFontsOpenSans' );
    wp_dequeue_style( 'google-fonts-1' );
add_action( 'wp_enqueue_scripts', 'remove_google_fonts_stylesheet', 12 );

It worked great for the "opensans" font, but the "google-fonts-1" which is actually roboto, won't seem to go away no matter what changes I make.

  • You can always increase the priority of the action, third argument. To better understand how a equeue is called I would suggest using Query Monitor, the best plugin while developing in WordPress, among other things it can give you all handles of style/css and priority. Sep 14 at 7:50
  • There are styles that are registered, for that you would need to use wp_deregister_style, just add both, if changing the priority didn't help and you are sure that you have the correct handle. Sep 14 at 7:53
  • Thanks Buttered, ive installed query monitor, but i still cant work out how to find the culprit, or the priority. Yeah i forgot to mention i tried about 20 different priorities, from 1 to 10 to 999. I also tried the deregister thing ( i think i did it properly) and it made no change either. Im hoping someone can take 5 mins out of thier day to find this info for me, as its probably super easy for someone who knows. Thanks for your time mate Sep 14 at 8:32
  • 1
    all good i figured it out, a known issue here with elementor github.com/elementor/elementor/issues/4075 Sep 14 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.