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

Don't index specific pages?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Don't index specific pages?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30110
    PCC76PCC76
    Participant

    Hi. I have a problem that is occurring with pages that have large tables on them. (see uploaded error message screenshot)
    There are very large tables on the page via a short-code from the plugin wpDataTables, I was wondering if there is a way to specify pages not to be index?
    Otherwise the only way I can think to stop this is to make a separate post type and don’t index it at all.

    Kind regards
    Dan

    #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.

    #30117
    PCC76PCC76
    Participant

    Thank you for your help. I will try the advanced menu options.
    Is there a way to wildcard or will it pick up anything from before the =, i.e this is a shortcode
    [table id=1 /]

    Could i put table_id, and it would ignore all following table numbers??

    • This reply was modified 5 years, 7 months ago by PCC76PCC76.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.