-
-
Save jchristopher/d9477b5852e219e676451b584889796f 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
<?php | |
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 ( false !== $url_found ) { | |
$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