Hello,

We use Taxonomy Access Control and Taxonomy to categorize our content and configure user permissions. We also use our taxonomy as a replacement for Published/Unpublished in Publishing Options, so we have Category and Category Unpublished. Is there a way to exclude all nodes from the sitemap which have been categorized as a certain term? If this functionality is not currently available, can you provide suggestions as to how we can integrate it into the existing module?

Thank you,
Peter

Comments

dave reid’s picture

Component: Code » xmlsitemap_node.module

Do you normal anonymous users have access to these nodes that you are wanting excluded? Because the xmlsitemap_node.module uses node_access('view', $node, drupal_anonymous_user()); to determine if the 'link' is included. If your taxonomy access module properly integrates with the node access system, these nodes would be excluded.

You can manually de-include each node once #470882: Individual node priority/exclusion is implemented. Otherwise you could modify the xmlsitemap_node_create_link() function to check what you need to check, but I'm always against modifying files.

pmlodzik’s picture

Dave,

Thank you for your prompt reply. Our Taxonomy Access configuration disallows anonymous access to nodes which are categorized as "Unpublished" or certain other restricted categories, so from what you said, it sounds like we should be all set. It's really nice to know that we don't need to tell the module to exclude restricted content.

Thanks again,
Peter

rf-pldev’s picture

You could also add your own cron task in a custom module that would set the priority_override value for whatever conditions you need. We have a custom attribute in the term_data table to indicate which terms are used to tag pages vs fragments. This cron method appears to be working well to exclude the fragments from appearing in the sitemap.

dave reid’s picture

Status: Active » Fixed

Since an appropriate answer has been provided and this feature already exists, marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.