apply_filters( 'relevanssi_missing_terms_template', string $template )

Filters the template for the “Missing terms” list.


(string) The template used for the missing words, default '<span class="missing_terms">' . __( 'Missing', 'relevanssi' ) . ': %s</span>'.

More information

If you want to modify how the “Missing terms” list from the %missing% breakdown tag appears, you can modify this template. Just keep the %s intact, as that’s where Relevanssi will place the actual terms.

For example, if you’d rather have the terms as a list, you can do this:

add_filter( 'relevanssi_missing_terms_template', 'rlv_terms_template' );
function rlv_terms_template( $template ) {
  return '<ul class="missing_terms">%s</ul>';

add_filter( 'relevanssi_missing_terms_tag', function( $tag ) { return 'li'; } );

The relevanssi_missing_terms_tag filter hook can be used to change the HTML tag around the individual terms, and if you’re using Relevanssi Premium, you can use relevanssi_missing_terms_must_have to modify the “Must have” part.