apply_filters( 'relevanssi_related_excerpt_length', int $length )

This filter hook filters the Related Posts excerpt length.


(int) The length of excerpt in (multibyte) characters. Default 50.

More information

If you choose to display excerpts for the Related Posts from the settings, the default template uses the hand-created excerpt for each post. If there isn’t one, Relevanssi creates one with

mb_substr( wp_strip_all_tags( $the_post->post_content ), 0, apply_filters( 'relevanssi_related_excerpt_length', 50 ) ) . '...';

To adjust the length of the created excerpt, you can use this filter hook:

add_filter( 'relevanssi_related_excerpt_length', function() { return 100; } );

This function would make the excerpt 100 characters long.