SearchWP Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP’s many hooks

searchwp\source\post\attributes\meta\ignored

Since: 4.0.0

Table of Contents

By default SearchWP ignores meta keys that do not contain search-worthy content. You can customize which key(s) are ignored with this hook.

Parameters

Type Parameter Default Since
Array $meta_keys Internal meta keys used by both WordPress and SearchWP that do not contain useful content 4.0.0
Array $args
Key Type Value
post_type String Post type name
4.0.0

Examples

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

Ignore additional meta keys

<?php
// Ignore additional meta keys in SearchWP.
add_filter(
'searchwp\source\post\attributes\meta\ignored',
function( $meta_keys, $args ) {
$meta_keys[] = 'my_not_useful_meta_key';
return $meta_keys;
},
20, 2
);

How to use this code