Skip to main contentSkip to footer

Here’s how you can disable Relevanssi Light for a particular post type. The example is shop_order from WooCommerce: you’ll need this if you use the legacy order storage. Otherwise, Relevanssi Light will stop the admin order search from working.


add_action('init', function() {
	add_filter( 'posts_search', function( $request, $query ) {
		if ( 'shop_order' === $query->query['post_type'] ) {
			remove_filter( 'posts_search', 'relevanssi_light_posts_search', 10 );
			remove_filter( 'posts_search_orderby', 'relevanssi_light_posts_search_orderby', 10 );
			remove_filter( 'posts_request', 'relevanssi_light_posts_request', 10 );
		}
		return $request;
	}, 1, 2 );
}, 11 );

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Search shortcode
Relevanssi adds a shortcode to help making links to search results. That way users can easily find more information about…

Related Posts:

Comment Section:

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed