Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriscct7/98aa70dc7832f36575ea7a739209b436 to your computer and use it in GitHub Desktop.
Save chriscct7/98aa70dc7832f36575ea7a739209b436 to your computer and use it in GitHub Desktop.
MonsterInsights Disable Frontend Tracking Disable Frontend Tracking for all users.
<?php
/**
* Plugin Name: MonsterInsights Disable Frontend Tracking
* Description: Disable Frontend Tracking for all users.
* Version: 1.0.0
* Author: MonsterInsights Support Team
* Author URI: https://www.monsterinsights.com
*/
function monsterinsights_custom_disable_frontend_tracking() {
remove_action( 'wp_head', 'monsterinsights_tracking_script', 6 );
remove_action( 'wp_footer', 'monsterinsights_scroll_tracking_output_after_script', 11 );
}
add_action( 'wp_head', 'monsterinsights_custom_disable_frontend_tracking', 0 );
function monsterinsights_custom_disable_events_tracking() {
remove_action( 'template_redirect', 'monsterinsights_events_tracking', 9 );
}
add_action( 'template_redirect', 'monsterinsights_custom_disable_events_tracking', 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment