Created
December 29, 2020 03:33
-
-
Save msaari/41a5637f5a7137d9f9e3da21de1c06a7 to your computer and use it in GitHub Desktop.
Excluding posts from the Relevanssi index
This file contains 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 | |
// Put this in your theme functions.php | |
add_filter( 'relevanssi_do_not_index', 'rlv_skip_page', 10, 2 ); | |
function rlv_skip_page( $skip, $page ) { | |
$excluded_pages = array( 123, 234 ); // List all the ID numbers of the excluded pages here. | |
if ( in_array( $page, $excluded_pages, true ) ) { | |
$skip = true; | |
} | |
return $skip; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment