Hi,
Of course, If the Recipe is custom post type you can just deselect it from settings in Extended Search > Search Setting: Select Post Types.
Thanks
Thank you. This is helpful, and I think I also see why it hasn’t been working. We’ve been adding the recipes from WP Recipe Maker to actual posts and using them that way. Is there a way instead to exclude a post category? In this case it’s a regular post, just with a Category “Recipes”. We don’t want it excluded from google search, just from the site global search, as we have a separate, and very effective, search for the recipes.
Hi,
WPES currently do not have any feature of exclude posts from certain categories. But this is easy to do with WP API. You can add the below code to your theme’s functions.php and replace the 1 and 10 with categories IDs to exclude.
In your case it just one category then Recipes
category ID.
/**
* Exclude posts from some certain categories.
*
* @param WP_Query $q
*/
function wpes_support_17810327( $q ) {
if ( function_exists( 'WPES' ) && WPES()->is_search( $q ) ) {
$q->set( 'category__not_in', [1, 10] ); // replace 1 and 10 with category IDs to exclude or add more category IDs.
}
}
add_action('pre_get_posts', 'wpes_support_17810327');
PS:- If this works for you, please leave a review about product/support.
Thanks
Thank you, @5um17 This totally solved my problem.