Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Don't index specific pages?
This topic contains 2 replies, has 2 voices, and was last updated by PCC76 3 years, 1 month ago.
- AuthorPosts
- November 2, 2020 at 6:03 pm #30110
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
DanAttachments:
You must be logged in to view attached files.November 3, 2020 at 8:55 am #30114Hi!
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.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 3, 2020 at 10:19 am #30117Thank 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 3 years, 1 month ago by
PCC76.
-
This reply was modified 3 years, 1 month ago by
- AuthorPosts
You must be logged in to reply to this topic.