Last active
November 7, 2019 17:33
-
-
Save mikeyarce/235cf03e4ed65d5f2ac71c68ada515b8 to your computer and use it in GitHub Desktop.
Disable WordPress Search #core
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 | |
function ma_vip_unresolve_search() { | |
global $wp_query; | |
if ( $wp_query->is_search ) { | |
$wp_query->is_404 = true; | |
} | |
} | |
add_action( 'template_redirect', 'ma_vip_unresolve_search' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment