Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ben Huson

    (@husobj)

    This should work:

    global $wpgeo;
    remove_action( 'wp_head', array( $wpgeo, 'wp_head' ) );

    You might need to do that within an ‘init’ action to ensure you try to remove it after it has been added.

    Thread Starter perryb

    (@perryb)

    Brilliant – this worked for me:

    add_action('template_redirect', 'remove_wp_geo_from_head');
    
    function remove_wp_geo_from_head() {
    
    	if ( !is_page( 'map' ) ) {
    
    		global $wpgeo;
    		remove_action( 'wp_head', array( $wpgeo, 'wp_head' ) ); 
    
    	}
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Geo] Conditionally remove WP-Geo code from wp_head()’ is closed to new replies.