Last active
January 12, 2020 13:38
-
-
Save davidroyer/28f0ba14c455d024d2d75342f7ea0d42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 wp_modify_search_filter( $query ) { | |
if ( $query->is_search && $query->is_main_query() ) { | |
$query->set( 'post__not_in', array( 1,2,3,4,5,6 ) ); | |
} | |
} | |
add_action( 'pre_get_posts', 'wp_modify_search_filter' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment