apply_filters( 'relevanssi_search_url_prefix', string $url_prefix )

When doing spam blocking, Relevanssi looks for this URL prefix for pretty URL searches.


(string) The URL prefix for pretty URL search pages, default /search/.

More information

When checking for spam search queries, Relevanssi first looks at $_REQUEST['s'] to see if there’s something. This covers the searches done with ?s=search+term. For pretty URLs like /search/search+term this does not work, and another approach is needed. Relevanssi looks at the $_SERVER['REQUEST_URI'] next to see if it begins with /search/ and if it does, gets the search query there.

If your site uses a different prefix for the pretty URL searches, you can use this filter hook to make Relevanssi spam blocking understand that.

add_filter( 'relevanssi_search_url_prefix', function() { return '/recherche/'; } );