MyListing Club

Disable Google Fonts

Building better MyListing websites. One code snippet at a time.

Overview

The Disable Google Fonts code snippet allows for better performance optimization within a MyListing website, by defaulting to MyListing’s built-in font (Glacial Indifference).

This snippet stops the loading of Google Fonts from loading in the MyListing theme and Elementor.

Reasons for not using Google Fonts might be privacy and security, local development or production, blocking of Google’s servers, characters not supported by font, performance.

Implementation

  1. Grab the code snippet.
  2. Follow the provided instructions.
  3. Save your changes.
				
					//// INSTRUCTIONS: 
//// Copy and paste the code snippet below into the child theme's functions.php file.
//// You can edit the functions.php file from your WordPress dashboard (Appearance > Theme Editor) or via FTP.

--------------------------- CODE SNIPPET IS BELOW THIS LINE --------------------------- 

// ELEMENTOR - DISABLE GOOGLE FONTS
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );

// MYLISTING - DISABLE GOOGLE FONTS
add_action( 'wp_enqueue_scripts', function() {wp_dequeue_style( 'c27-google-fonts' );}, 10 );