Exact match not working | WordPress.org

[ad_1]

Your search results are not ordered by relevance. If I add &orderby=relevance to the end of the search results page URL to force the order to be by relevance, the exact match results are first.

Try adding this function to your theme functions.php or in a code snippet to force the result order:

add_filter( 'relevanssi_modify_wp_query', function( $query ) {
  $query->set( 'orderby', array( 'relevance' => 'desc' ) );
  return $query;
} );

Thread Starter
fooey

(@fooey)

That seemed to do the trick! One question, in my settings it is supposed to sort by relevance, Is there something overwriting this? Kinda the point of the plugin ay? : )
thanks

orderby is a common WordPress query parameter, and other plugins may mess with it. Common culprits are all sorts of custom post order plugins.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer