Note: You are viewing the documentation for Version 3View Version 4 Docs


View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

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

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP