Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ideadude/27912cd472e1216ba73420386ddae2ce to your computer and use it in GitHub Desktop.
Save ideadude/27912cd472e1216ba73420386ddae2ce to your computer and use it in GitHub Desktop.
Change PMPro to only track visits for logged in users.
/**
* Change PMPro to only track visits for logged in users.
* Add this code into a custom plugin or code snippet.
*/
function my_pmpro_report_login_wp_visits_only_for_users() {
if ( ! is_user_logged_in() ) {
remove_action( 'wp', 'pmpro_report_login_wp_visits' );
}
}
add_action( 'init', 'my_pmpro_report_login_wp_visits_only_for_users' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment