Title: Simple Custom Post Order
Last modified: January 9, 2024

---

# Simple Custom Post Order

 *  Resolved [EloWi](https://wordpress.org/support/users/guigasoil/)
 * (@guigasoil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/simple-custom-post-order/)
 * Hi, I am using the ‘Simple Custom Post Order’ plugin. When it is deactivated,
   the relevanssi search works fine. However, when it is activated, even after adding
   the function ‘add_filter( ‘relevanssi_orderby’, function ( $orderby ) {return‘
   relevance’; } );,’ the search does not work. Is there any other element to add
   in the functions.php file? It used to work well with this function some time 
   ago… thanks a lot !

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/simple-custom-post-order/#post-17330982)
 * It’s almost right. Simple Custom Post Order does two things, and that snippet
   fixes only one of them. This version fixes both:
 *     ```wp-block-code
       add_filter( 'relevanssi_orderby', function ( $orderby ) { return array( 'relevance' => 'desc' ); } );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Simple Custom Post Order’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/simple-custom-post-order/#post-17330982)
 * Status: resolved