This Documentation is for SearchWP Version 3

Available since: 3.0


View Parameters »

When highlighting is enabled SearchWP will stop finding terms to highlight once the first match is found. This is because search terms can be modified by other code potentially leading to unwanted highlights appearing. You can control this behavior with the following hook:

// Stop SearchWP from breaking highlight on first match.
add_filter( 'searchwp_term_highlight_break_on_first_match', '__return_false' );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$break_on_first_match Boolean

Whether to stop highlighting on the first match