Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Disabling Relevanssi Light for a specific post type

Дата публикации: 20-04-2026 14:29:11

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'] )...
Source

Основное содержимое страницы с новостью.

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.

SearchPopular Resources
Indexing custom post statuses

If you’re using custom post statuses, Relevanssi requires some tinkering. By default, Relevanssi only handles posts that are of status…

Events Calendar: Remove past events from search

If you have events on your site, you might not want to show the past events in the search. This is easy to do with Relevanssi. It can be done in two ways: either you block the past events in indexing or in searching. In most cases, the best solution…

Related Posts:
Comment Section:

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Removing Relevanssi from the quick edit04.702-03-2026
2The wrong content gets indexed for a post06.2227-01-2026
3Add more content to the index for Relevanssi Light01020-04-2026
4Premium 2.30 / Free 4.27011.6512-05-2026
5Voice Search07.3412-05-2026
6La desinfluencer0026-05-2026
7EU Member States (and Google) suddenly want to keep cookie banners!08.6323-06-2026
8Meta ignores the users’ right to easily withdraw consent06.7611-01-2024
9Ads: Meta wants to be 'less illegal' - but much more annoying...07.5212-11-2024
10 Рег.решения начнут адаптировать сайты под нейропоиск 5705-06-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 9.04. Источник: www.relevanssi.com.