SearchWP

This Documentation is for SearchWP Version 3

Available since: 2.8.16

searchwp_query_allow_query_string_override_order

View Parameters »

By default SearchWP sorts results in DESC order according to the calculated weight (e.g. higher weight means more relevance which results in a higher search results rank) which can be overridden using the searchwp_query_orderby hook, or this hook if you’d prefer the control to be offered via query string.

SearchWP allows for a query string override by default, but you can disable it with the following:

<?php
// Prevent SearchWP from accepting a query string to accept results order.
add_filter( 'searchwp_query_allow_query_string_override_order', '__return_false' );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$allow Boolean

Whether SearchWP should accept the query string

[wpforms id="3080"]