Skip to content

Instantly share code, notes, and snippets.

@kjbrum
Last active May 21, 2016 02:20
Show Gist options
  • Save kjbrum/3c4370dd3b9426bc5add to your computer and use it in GitHub Desktop.
Save kjbrum/3c4370dd3b9426bc5add to your computer and use it in GitHub Desktop.
Disable searching if it isn't needed.
<?php
// Disable Searching
add_action( 'parse_query', function($query){if(is_search())$query->is_404=true;} );
add_filter( 'get_search_form', 'return null' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment