MyListing Club

Remove Map Functionality and API Calls

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

Overview

The Remove Map Functionality and API Calls code snippet will help speed up MyListing websites that don’t need map services.

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 --------------------------- 

// REMOVE MAP FUNCTIONALITY AND API CALLS
add_action( 'wp_enqueue_scripts', function() {
    wp_dequeue_script( 'google-maps' );
    wp_dequeue_script( 'mylisting-maps' );
    wp_dequeue_style( 'mylisting-maps' );
}, 1000 );