apply_filters( 'relevanssi_post_type_additional_content', string $description, WP_Post_Type $post_type_object )

This hook filters the post type object before it is indexed.


(string) The post type description.

(WP_Post_Type) The post type object.

More information

Relevanssi Premium can index post type archives. A user who searches for a post type name can then get the post type archive as a result. By default, Relevanssi indexes the post type title and the post type description if there’s one (often there isn’t).

If you want to add more content to the post type archive before indexing, this filter hook is the best way. The filter gives you the post type description, and you can change it or add to it.

add_filter( 'relevanssi_post_type_additional_content', 'rlv_add_to_post_type_books', 10, 2 );
function rlv_add_to_post_type_books( $description, $post_type_object ) {
  if ( 'books' === $post_type_object->name ) {
    $description .= ' A book is a rectangular object made of cardboard and paper, containing words and stuff.';
  return $description;

You can also use the relevanssi_post_to_index filter hook to modify the post type archive before indexing.