Sorry for delay. I was never alerted to a response by email. Let me try to describe it better.
I use PHP to make a master sitemap.xml file, which creates a number of trailers-1.xml, trailers-2.xml files until it covers all the rows. I basically divide the total rows by 4000, and it runs a loop on the number it comes back with to output the right amount of sitemap files, each with 4000 rows, except for the last one.
http://www.traileraddict.com/sitemaps/trailers/1.xml
http://www.traileraddict.com/sitemaps/trailers/2.xml
http://www.traileraddict.com/sitemaps/trailers/3.xml
http://www.traileraddict.com/sitemaps/trailers/4.xml
http://www.traileraddict.com/sitemaps/trailers/5.xml
It’s all great, and Google checks this sitemap file every couple of minutes. Now, I want to add the tag to the master sitemap file. The date should be the date of the most recent that will be inside the site map. so…
<sitemap>
<loc>http://www.traileraddict.com/sitemaps/trailers/22.xml</loc>
<lastmod>2016-02-09</lastmod>
</sitemap>
This sitemap has rows that were added years ago (about 88,000 rows back), since the sitemaps are in order of the ID of when they were first added or of the date they were first added, not when they were updated. But one particular row got updated with new information/content, so somewhere inside that sitemap above there is a row that has:
<url>
<loc>http://www.traileraddict.com/the-other-guys/san-diego-comic-con-panel-eva-mendes</loc>
<lastmod>2016-02-09T07:31:40-07:00</lastmod>
<changefreq>yearly</changefreq>
<priority>0.6</priority>
</url>
So though most the rows are years old, this sitemap has a row that was updated on February 9th, so it’s the most recently updated of this entire sitemap. Since the most recently modified in the sitemap is the lastmod date of the entire sitemap, I’d like that to reflect.
I know the datemod is not exactly necessary, but would be cool if there was a way to pull it off.
I’m hoping that makes sense. The rows inside the sitemaps are in ORDER of when first added, but I need the date reflected of the last modified.
Cheers!
Ryan