Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add additional content to a specific Custom Field during indexing in SearchWP
<?php
// Add additional content to a specific Custom Field during indexing in SearchWP.
add_filter( 'searchwp\source\post\attributes\meta\my_custom_field_key', function( $meta_value, $args ) {
// Add 'coffee' to Custom Field value to make it searchable.
return $meta_value . ' coffee';
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment