apply_filters( 'relevanssi_admin_search_blocked_post_types', array $blocked_post_types )

Filters the post types that are blocked in the admin search.


(array) A list of post types Relevanssi shouldn’t try searching.

More information

In some cases you may want to enable Relevanssi in the admin backend, but don’t want Relevanssi to search certain post types in the admin. To block Relevanssi from a specific post type, add the post type to this filter. For these post types, the admin search will then fall back to the default WP search.

This is especially important for post types where it makes no sense for Relevanssi to index the post types in the first place, yet searching for them in the admin is necessary.

If you want to disable Relevanssi admin search for the amazing_widgets post type, you can do it like this:

add_filter( 'relevanssi_admin_search_blocked_post_types', function( $blocked_post_types ) { return array_merge( $blocked_post_types, array( 'amazing_widgets' ) ); } );