Hey @jpnl –
From my understanding, you should be able to add my code snippet from above to your functions.php file.
add_filter('searchexclude_filter_search', 'filterExclude', 10, 2);
function filterExclude($exclude)
{
return $exclude = true;
}
This should exclude any pages marked to be excluded with the Search Exclude plugin on all searches throughout your site. If that isn’t what you want, you can try adding it to just that 404 page template.
P.S. If you aren’t using a child theme as of yet, this would be a good time to start. Good luck!
Just was able to figure this out. Seems like you need to set the search exclude function to true. I added the following code to my search query and it works now.
add_filter('searchexclude_filter_search', 'filterExclude', 10, 2);
function filterExclude($exclude)
{
return $exclude = true;
}
Hey @jpnl –
I’m having the same problem. My custom query worked for years and now is broken. Were you able to find a solution at all?
Thanks!
Joe