SearchWP

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

<?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;
} );

How to use this code