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

Documentation

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

Available since: 2.0

searchwp_exclusive_regex_matches

Note: Use of this hook will require a manual reindex

SearchWP uses what it calls a Regex Whitelist when indexing content. This Regex Whitelist is an array of regular expression patterns that are evaluated prior to indexing content. These matches are excused from further tokenizing and sanitization and indexed as they sit.

By default, SearchWP does not remove the matches from the content pool, which results in both the regular expression matches and the tokenized versions of those matches to both be indexed. If you would instead prefer that only the regex matches themselves are included in the index, add the following to your theme’s functions.php:

<?php
add_filter( 'searchwp_exclusive_regex_matches', '__return_true' );
view raw gistfile1.php hosted with ❤ by GitHub
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