Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 25, 2022 18:00
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 searchwpgists/4ace6195f4c5d3eaedd39370e88ead55 to your computer and use it in GitHub Desktop.
Save searchwpgists/4ace6195f4c5d3eaedd39370e88ead55 to your computer and use it in GitHub Desktop.
Disable SearchWP's logging of searches for anyone who is logged in
<?php
// Disable SearchWP's logging of searches for anyone who is logged in.
add_filter( 'searchwp\statistics\log', function( $enabled, $query ) {
return ! is_user_logged_in();
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment