Remove Google font

Hi,
I’m trying to remove Google fonts but it does not seem to work, When I use a service like Pingdom Tools I can 4 requests from: fonts.gstatic.com

In functions.php, I found:

  // Add Google Fonts
  wp_register_style( 'sparkling-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400italic,400,600,700|Roboto+Slab:400,300,700');

  wp_enqueue_style( 'sparkling-fonts' );

In my child theme, I added:

function unhook_parent_style() {

  wp_dequeue_style( 'sparkling-fonts' );
  wp_deregister_style( 'sparkling-fonts' );
}
add_action( 'wp_enqueue_scripts', 'unhook_parent_style', 20 );

But it does not seem to work.
Thanks

Hi @alex1,

I hope you are well today and thank you for your question.

The shared code should work and is working for me.

If it is not for you then please use the attached child theme that contains that code and works fine for me.

Best Regards,
Movin

Thanks ! I’ll try :slight_smile:

You are most welcome here :slight_smile: