Tag: SearchWP

  • Allow two character words in SearchWP results

    Useful if there’s a commonly used abbreviation on the website e.g. UT, that wouldn’t otherwise be returned in SearchWP results (default word length is three).

    <?php
    
    /**
     * Reduce SearchWP's minimum character length to 2 (default is 3).
     *
     * @url https://searchwp.com/documentation/hooks/searchwp-tokens-minimum_length/
     */
    add_filter( 'searchwp\tokens\minimum_length', function ( $min ) {
    	return 2;
    } );
  • Disable override of default search engine in SearchWP

    add_filter( 'searchwp\native\short_circuit', '__return_true' );