Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created January 22, 2014 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/8553076 to your computer and use it in GitHub Desktop.
Save jchristopher/8553076 to your computer and use it in GitHub Desktop.
Modify which meta keys are excluded by the SearchWP indexer
<?php
function my_searchwp_excluded_custom_fields( $keys ) {
// by default _wp_page_template is excluded but we want to include that
// so we'll return everything else we want excluded
$keys = array(
'_edit_lock',
'_edit_last',
'_wp_old_slug',
);
return $keys;
}
add_filter( 'searchwp_excluded_custom_fields', 'my_searchwp_excluded_custom_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment