Created
December 2, 2016 03:00
-
-
Save anonymous/ce5c095429400cb98e1449bd08e7dc09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_searchwp_omit_meta_key( $omit, $meta_key, $the_post ) { | |
$url_meta = 'link-url'; | |
$url_found = strpos($meta_key,$url_meta); | |
// if "link-url" is in a custom field meta key name, do not index it | |
if ($url_found == true) { | |
$omit = true; | |
} | |
return $omit; | |
} | |
add_filter( 'searchwp_omit_meta_key', 'my_searchwp_omit_meta_key', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment