searchwp\valid_html_tags
Since: 4.0.0
Table of Contents
Control which HTML tags SearchWP will consider when extracting content to index.
Parameters
Type | Parameter | Default | Since |
---|---|---|---|
Array | $tags |
Multidimensional array of tags and tag attributes | 4.0.0 |
Examples
All hooks should be added to your custom SearchWP Customizations Plugin.
Prevent input attributes (e.g. placeholder) from being indexed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prevent input attributes (e.g. placeholder) from being indexed by SearchWP. | |
add_filter( 'searchwp\valid_html_tags', function( $tags ) { | |
unset( $tags['input'] ); | |
return $tags; | |
} ); |