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: 2.8.4


View Parameters »

By default SearchWP retrieves all approved comments for the current post when indexing arguments. You can use this hook to customize those arguments:

add_filter( 'searchwp_indexer_comments_args', function( $args ) {
// TODO: modify $args to meet your needs. Arguments are sent to get_comments()
// @link
return $args;
} );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$args Array

Arguments used to retrieve comments for the post being indexed, sent directly to get_comments()

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