Sitemap children


So I am working on a new site. Part of that is a timeline where all of the timeline->children() are not set to public, they are simply displayed as part of the timeline page.

I just noticed on the Sitemap that all of the timeline->children() are listed which I don’t want.

I have followed the Sitemap for search engines | Kirby CMS guide and that is fine for removing pages but how would I remove children from the sitemap?


You can merge the config settings with the ids of the timeline children:

$timelineChildren = ($timeline = page('timeline')) ? $timeline->children()->pluck('id', ',') : [];
$ignore           = array_merge($timelineChildren, kirby()->option('sitemap.ignore', ['error']));

Thanks, @texnixe that works. I was nearly there!