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


Since: 4.0.0

Table of Contents

When Comments have been added to a WP_Post-based Source, control whether the Comment Email is indexed.


Type Parameter Default Since
Boolean $enabled false 4.0.0
Array $args
Key Type Value
post_id Integer Post ID


All hooks should be added to your custom SearchWP Customizations Plugin.

Index Comment Author Email

// Enble Comment Author Email indexing in SearchWP.
add_filter( 'searchwp\source\post\attributes\comments\email', function( $enabled, $args ) {
return true;
}, 10, 2 );

How to use this code

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