- 🇺🇸United States j_s
Old but still active issue. For 8.x-1.5, this worked for me:
$rebuild_types = xmlsitemap_get_rebuildable_link_types(); $batch = xmlsitemap_rebuild_batch($rebuild_types, TRUE); batch_set($batch);
My site has some specific access/pubblication workflows about nodes so I'd like to run via code the rebuild function of your module that I find in admin/config/search/xmlsitemap/rebuild
I tried with this custom code during a cron job:
module_load_include('admin.inc', 'xmlsitemap');
xmlsitemap_rebuild_form();
This doesn't returns me errors but I see the form does not add new links to my sitemap.xml file but if I run it manually from the page it works.
Can you please tell me ho to trigger via code the rebuild of XML sitemap?
Thanks!
Active
2.6
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Old but still active issue. For 8.x-1.5, this worked for me:
$rebuild_types = xmlsitemap_get_rebuildable_link_types();
$batch = xmlsitemap_rebuild_batch($rebuild_types, TRUE);
batch_set($batch);