Created
December 22, 2015 03:13
-
-
Save bhubbard/d075c601d05cafd69984 to your computer and use it in GitHub Desktop.
Disable Jetpack stats for all IDX Wrapper pages. Used this site as a reference for the code: https://www.skyverge.com/blog/exclude-your-traffic-from-jetpack-site-stats/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'template_redirect', 'idxbroker_disable_jetpack_stats' ); | |
function idxbroker_disable_jetpack_stats() { | |
// Check that we are on a single IDX Wrapper | |
if ( is_singular('idx-wrapper') ) { | |
remove_action( 'wp_footer', 'stats_footer', 101 ); | |
remove_action( 'wp_head', 'stats_add_shutdown_action' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment