Google SearchConsole Errors - old updated pages

About a year ago Google started sending me emails for mobility and breadcrumb errors, like viewport not set, text too small to read, data-vocablulary.org deprecated, etc.

Over the summer I fixed the entire site of about 400+ pages by updating a few templates (isn’t MODx grand). Now every couple of months Google will email out another group of pages pointing out the old errors that don’t exist anymore. Google actually shows a last crawled date for these pages at over a year ago.

Could there be a problem with my sitemap which is generated by the default GoogleSiteMap snippet? It seems like the <lastmod> tag doesn’t seem to update when a template is edited. Or is there some way to tell Google SearchConsole that the whole site has been updated and needs to be re-indexed before they look for more errors.

I’m unaware of a way to get Google to re-index the entire site via the search console. As far as I know, you can for single URLs or via the sitemap.

It looks like the GoogleSiteMap extra uses the date when the resource was last edited rather than when the template was. Templates don’t have that particular field.
What you could do is write a snippet that changes the editedon field for any resource that is using a certain template.

Something like:

<?php
$templateId = 18; // change this to template id you updated

$resources = $modx->getIterator('modResource',[
    'template'  =>  $templateId
]);
if(empty($resources)) return '';
    
foreach($resources as $resource) {
    $resource->set('editedon', time());
    $resource->save();
}

return '';