# Return the results in the descending order of relevance in Relevanssi

**URL:** <https://community.mainwp.com/t/return-the-results-in-the-descending-order-of-relevance-in-relevanssi/8006>\
**Category:** Code Snippets\
**Tags:** wordpress\
**Created:** [December 7, 2023, 8:41pm UTC](https://community.mainwp.com/t/return-the-results-in-the-descending-order-of-relevance-in-relevanssi/8006 "2023-12-07T20:41:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian-moran](https://community.mainwp.com/user_avatar/community.mainwp.com/sebastian-moran/32/16_2.png) [@sebastian-moran](https://community.mainwp.com/u/sebastian-moran)\
**Post date:** [December 7, 2023, 8:41pm UTC](https://community.mainwp.com/t/return-the-results-in-the-descending-order-of-relevance-in-relevanssi/8006/1 "2023-12-07T20:41:04Z")

</div>

Return the results in the descending order of relevance in Relevanssi.

**Snippet Type**

`Execute on Child Sites`

**Snippet**

```auto
add_filter( 'relevanssi_orderby', 'rlv_fix_order' );
function rlv_fix_order( $orderby ) {
  return array( 'relevance' => 'desc' );
}

```

---

<div class="post-metadata">

**Author:** ![system](https://community.mainwp.com/uploads/default/original/2X/4/4cfc87ac67e4ebdbfa0bbf0b19c8657f35a29a5b.png) [@system](https://community.mainwp.com/u/system)\
**Post date:** [January 6, 2024, 8:41pm UTC](https://community.mainwp.com/t/return-the-results-in-the-descending-order-of-relevance-in-relevanssi/8006/2 "2024-01-06T20:41:30Z")

</div>

Closed on January 6, 2024, 8:41pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
