Created
May 8, 2015 00:17
-
-
Save ericakfranz/32f0571b12b972643203 to your computer and use it in GitHub Desktop.
Exclude Envira Galleries from search results.
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
add_filter( 'envira_gallery_post_type_args', 'filter_envira_search' ); | |
function filter_envira_search( $args ) { | |
$args['exclude_from_search'] = true; | |
return $args; | |
} |
best way is to add -to functions.php in your child theme
Thanks for this! No idea why they still haven't disabled this themselves after more than 3 years.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this! I added that code at the end of /wp-includes/default-filters.php - it works fine but I have a question: Is adding it to default-filters.php the right place to follow WP best practices, or should this code be added somewhere else or called another way?