I have some special criteria that I want to use to include a node in the xml sitemap. My thinking is that I will set the xmlsitemap settings for the content type to exclude. Then I will use a Rule to trigger on a node's creation and if it passes the conditions then to add a 'execute php code' action which will create the link array and call the xmlsitemap_link_save function.

Should I set the type to 'node' or 'custom'? Will this work, and the link be included in the generated sitemap even if the content types general settings are set to exclude?

Comments

markusa’s picture

Tried adding this code to execute in a Rule when new content is created.

$link = xmlsitemap_node_create_link($node);
$link['status'] = 1;
xmlsitemap_link_save($link);

This seems to circumvent the general settings that would exclude that node type from being indexed.

Anyone see any problems that would arise from this strategy?