Closed DrJoppix closed 7 months ago
Hi @DrJoppix you are trying to exclude certain taxonomy terms? There is indeed no filter for that yet.
I'll add it to the TODO list :)
I'd like to include terms without any posts in the sitemap, too ('hide_empty' => false
). Would it be possible to add a filter to the argument array passed into get_terms, please? Maybe something like this.
$args = apply_filters('xmlsf_feed_args_taxonomy', ['taxonomy' => get_query_var('taxonomy')]);
$terms = apply_filters('xmlsf_feed_data_taxonomy', get_terms($args));
Hi @ericek111 I'll add this to the feature request list. The "hide empty" might even make it as an option ;)
Update: filtering sitemap entry URLs can now be done with the xmlsf_entry_url
filter, read more on https://premium.status301.com/knowledge-base/xml-sitemap-google-news/filter-hooks/xmlsf_entry_url/
In the upcoming version 5.5, a filter xmlsf_taxonomies_query_args
is planned. So currently not available yet. But you could set the sitemap Server to WordPress on Settings > XML Sitemap, and then use the WP core filter wp_sitemaps_taxonomies_query_args
...
Hi RavanH,
Using your plugin I noticed that we can't filter the taxonomy terms, only the root pages and the authors. The only way I found was by using
get_terms
filters. This way isn't the best option. Is it possible to apply a filter for this request, something like$terms = apply_filters( 'xmlsf_taxonomy_data', $terms, $terms_taxonomy );
before the foreach?Thank You from Italy!