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

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

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