Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Don't index specific pages? › Reply To: Don't index specific pages?
November 3, 2020 at 8:55 am
#30114
Keymaster
Hi!
Well, there is no option on the back-end to ignore them, but if you don’t need the table contents at all, you can specify the datatables shortcode to be ingored completely: https://i.imgur.com/pLh6jfh.png
Another option is only programmatical. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter('asp_post_content_before_tokenize_clear', 'asp_ignore_ids_content_index', 10, 2);
function asp_ignore_ids_content_index( $content, $post ) {
$ids_to_ignore = array(1, 2, 3); // Comma separated list of post/page/CPT ids
if ( in_array($post->ID, $ids_to_ignore) ) {
return '';
}
return $content;
}
Change the $ids_to_ignore variable to add the post/page or other custom post type IDs to be ignored by the content indexer.