relevanssi_index_content

apply_filters( 'relevanssi_index_content', bool $index )

Controls whether post content is indexed or not.

Parameters

$index
(bool) If true, index post content. Default true.

More information

If you don’t want to include the post content in the search at all, the best way to stop that is using this filter hook by adding this line to your theme functions.php:

add_filter( 'relevanssi_index_content', '__return_false' );

This will short circuit the content indexing. Make sure you rebuild the index after adding the line. This will make indexing much faster, the index a lot leaner and the search faster – but of course with the price of losing the post content. But sometimes that makes sense, and in those cases, this is the best way to stop Relevanssi from indexing the post content.

If you want to exclude post titles from the index, use relevanssi_index_titles for that. If you want to selectively block content from some posts, you can use relevanssi_post_content and return an empty string for the posts where you don’t want the content indexed.