Jump to content

Sitemap — a new XML sitemap module with sitemap index, IndexNow, and an admin dashboard


Recommended Posts

Posted

I've been working on sites where the standard sitemap setup started showing cracks: XML generated on every request eating memory, no way to regenerate automatically without writing custom hooks, and no visibility into what actually ended up in the file.

So I built Sitemap — a module that generates static XML files to disk, splits output by template name, and handles the full lifecycle from generation to search engine notification.

What it does differently:

  • Writes files to disk instead of rendering in memory — no RAM spike on large sites
  • Pages are fetched in chunks of 500 with uncacheAll(), so memory stays flat regardless of page count
  • Each template gets its own named file: sitemap-product.xml, sitemap-blog.xml, etc. — the index at sitemap.xml references them all
  • Auto-regeneration via LazyCron with a configurable interval; the LazyCron hook slot is chosen dynamically to match what you configured (every hour, every 6 hours, daily, etc.) rather than always using everyHour
  • A needs_regen flag is set whenever a page is saved, trashed, or deleted — visible in the admin dashboard
  • IndexNow support: after generation, all URLs are submitted to api.indexnow.org in batches of 10,000
  • Sitemap: directive written directly to the physical robots.txt on save and on generate
  • Lock file prevents concurrent generation
  • Admin dashboard at Setup > Sitemap showing file count, URL count, total size, and last generated time

Settings stored in a dedicated DB table (sitemap_settings, name/value, MEDIUMTEXT) rather than the module's data field — avoids the serialized config size limit when template settings grow large.

Image sitemap extension and hreflang alternate links for multilanguage sites are both supported.

GitHub:

Screenshots:

sitemap1.thumb.png.3e0299bd10ade2595a9fa7958f3ba602.png

sitemap2.thumb.png.a8e9ade7e2eff6f5d608998de7e334e9.png

Still v1.0.0, so feedback is very welcome — especially from anyone running it on a site with 10k+ pages.

  • Like 5
  • Thanks 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...