When validating my XML sitemap, google says:
Invalid date An invalid date was found. Please fix the date or formatting before resubmitting.
I convert the mysql timestamp by:
gmdate('Y-m-d\TH:i:s', strtotime($row['modified']['value']))
Out dated sitemap can't any harm done for your site but it's beneficial that you regularly update your sitemap because Search engine easily crawl your website updates.
“Sitemap could not be read” often mean that Google just hasn't fetched the file. You can reload the page, or try to check the sitemap in the URL Inspection Tool.
The 'lastmod' element has to be of the format YYYY-MM-DD
or YYYY-MM-DDThh:mmTZD
so use:
gmdate('Y-m-d', strtotime($row['modified']['value']))
or
gmdate('Y-m-d\TH:i:s+00:00', strtotime($row['modified']['value']))
Read more here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With