Skip to content
Ben GarvesLinkedIn
Menu

Add lastmod to Sitemap

[SEO-11] Add lastmod elements to sitemaps

From Ben Garves’s work at Udemy. Re-created from the original document, with people’s names, internal links and non-public numbers removed or generalized. Sections by others are labeled.

TaskSEO-11

Company
Udemy
Created
Resolved
Status
Done
Priority
P2 - Medium
Story points
2
Project
SEO Squad
Sprint
SEO Sprint 1
Requirement source
Engineering

A task to add lastmod dates to Udemy’s sitemaps so crawlers can tell which pages are new or changed and prioritize crawling them, following Google’s sitemap documentation.

  • Technical SEO
  • Sitemaps
  • Crawling

User story

As a crawler, I’d like Udemy’s sitemaps to include <lastmod> elements so that I know which content is new or has changed and can prioritize crawling them.

Google sitemap documentation: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap#xml

Outcome

Summarized from the engineer’s closing comment.

The course sitemap now includes a <lastmod> tag for each course, holding the course’s last-updated timestamp, and is sorted by most recently updated instead of by ID, so new and recently updated courses appear at the top.

An illustrative sample of the delivered format, transcribed from a screenshot attached to the ticket, with placeholder values for the course URL and date:

xml

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.udemy.com/course/course-slug/</loc>
    <lastmod>YYYY-MM-DD</lastmod>
  </url>
  …
</urlset>