Note: You are viewing the documentation for Version 3View Version 4 Docs

Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

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

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP