vipnytt/sitemapparser
A lightweight PHP library for parsing XML sitemaps and sitemap indexes. It recursively follows sitemap index files, extracts URLs, handles gzip compression, detects sitemap types, and supports robots.txt discovery with no external dependencies.
Consider it when:
sitemaps.org-compliant XML, including sitemap indexes and gzipped sitemaps — the two things people most often underestimate when hand-rolling.Look elsewhere or build in-house when:
xhtml:link/hreflang alternates). For anything customer-facing or long-lived, plan to fork-and-pin, or write the parser.robots.txt Sitemap: discovery, rate limiting, retries, backoff, conditional GET, concurrency — expect to build all of it. (The same author's robotstxtparser covers discovery if you stay in the ecosystem.)Http:: for timeouts, retries, proxies and logging; be prepared to bypass the built-in fetcher and feed it responses.symfony/dom-crawler plus a thin custom parser; a hosted crawler for one-off audits (cheaper than building); spatie/sitemap if the need is generation rather than parsing — a common mix-up in requirements.Adoption checklist: fork and pin to a commit, wrap behind an interface (see below), build a fixture suite covering nested indexes, .gz, malformed XML, and empty sitemaps, and add SSRF allowlisting on fetched hosts.
To executives: "We need to read sitemaps for [SEO audit / partner content import]. A small MIT-licensed library gets us most of the way in days rather than weeks. The caveat: it's no longer maintained, so we'd take a copy into our codebase and own it — roughly 1–2 engineer-days of wrapper and test work. That's the low-risk part. The real cost is the pipeline around it — fetching, scheduling, storage, diffing — which we'd be building regardless of which parser we pick."
To engineering: "Focused single-purpose parser: XML in, URLs out, with sitemap-index recursion and gzip handled. Not Laravel-aware — no service provider, no config, and it ships its own cURL fetch layer. My recommendation: bind it behind a SitemapReader interface, keep all fetching in Laravel's HTTP client so we get timeouts, retries, allowlisting and observability, and use the library strictly for parsing. Because it's archived we fork and pin; the exit path is a small in-house parser if we ever need streaming, sitemap extensions, or a security patch."
How can I help you explore Laravel packages today?