Google has advised website owners not to include lastmod dates in their XML sitemaps if those dates are inaccurate. According to Google's Gary Illyes, incorrect lastmod dates are more harmful than not having them at all.
Google Recommends Using Lastmod Only When It's Accurate
The clarification came after Jason Kilgore asked whether a website is better off without any lastmod dates or with dates that are not always reliable because of a bug.
Replying on Bluesky, Gary Illyes said, "Probably better off without the lastmods. At least you save a few bytes." His response suggests that if a site cannot provide accurate lastmod information, it's safer to leave the field out instead of sending incorrect signals to Google.
This is consistent with Google's long-standing guidance. Google's stated several times that they place their trust in the lastMod timestamp only when it shows that major changes have been made to the content of the page. For instance, simple changes like modifying the copyright year or doing some minimal formatting updates can be considered as minor edit and should not influence the new lastMod date.
Google has also warned against updating lastmod too frequently or using it as an SEO tactic. If Google notices that the dates are unreliable, it may stop trusting them altogether.
So, all in all, it is advised to use the lastmod tag only in case you have made important updates on your page content and want your visitors to know that. In case you can't get your sitemap to create correct dates, the right thing to do is not include them at all rather than showing false data.