Hi @marie-aude,
Could you please check the following example snippet and see whether it fits your needs:
<?php
add_filter( 'wds_terms_sitemap_include_term_ids', 'wpmudev_exclude_terms_ids', 9999, 2 );
function wpmudev_exclude_terms_ids( $include_ids, $taxonomies ){
$term_query = new Smartcrawl_Sitemap_Terms_Query();
$types = array();
$types = empty( $types ) ? $term_query->get_supported_types() : array( $types );
$term_query = new WP_Term_Query( array(
'taxonomy' => $types,
'fields' => 'ids',
'exclude' => array(1,155)
) );
$term_ids = $term_query->get_terms();
if ( empty( $term_ids ) ) {
$term_ids = array( - 1 );
}
$include_ids = empty( $include_ids ) || ! is_array( $include_ids )
? array()
: $include_ids;
return array_merge( $include_ids, $term_ids );
}
Where the following line is where the terms are added:
'exclude' => array(1,155)
You’ll need to replace the array with your term IDs ie if the term IDs are 1, 2, 3 then the above line would be:
'exclude' => array(1,2,3)
`
You can implement the above code as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Kind Regards,
Nithin