I have a series of "Thank You" pages which result from different form submissions. I would like to be able to exclude these from sitemaps based on their template. Specifically, and as an easy example, excluding them from being listed on the basic 404 page which utilizes the wp_list_pages.
I know how to manually exclude by ID but am looking for a better way to do this on scale and a more simplified approach--rather than having to edit code.
Is this approachable from a template perspective (code in template) or from the hook perspective (exclude by template vs exclude by ID). Essentially, the goal is to make this easier for front end content creators so as to avoid having to include multiple people in the process of publishing a single page.
'exclude' => 'template-name', versus the standard 'exclude' => '17',