This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Don't index specific pages?

#30114
Ernest MarcinkoErnest Marcinko
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.