Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sitemap Laravel Package

laravelium/sitemap

Framework-agnostic PHP package for generating XML, TXT, HTML, and Google News sitemaps. Works with Laravel, Symfony, or any PHP project, with support for images, videos, translations, alternates, and Google News. Includes extensible adapters and high test coverage.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • SEO & Discoverability: Enables dynamic, automated sitemap generation for improved search engine indexing, directly supporting organic traffic growth and visibility.
  • Content Management: Simplifies sitemap updates for CMS-driven applications (e.g., blogs, e-commerce) by syncing with database changes or content workflows.
  • Localization & Multilingual Support: Facilitates SEO for global audiences via alternates and language-specific sitemaps, aligning with i18n roadmaps.
  • Performance Optimization: Reduces crawl budget waste by dynamically excluding low-value pages (e.g., admin routes) via configurable rules.
  • Compliance & Standards: Ensures adherence to Google News sitemap requirements for publishers, unlocking potential traffic from Google Discover.
  • Build vs. Buy: Eliminates custom development for sitemap logic, saving engineering time while maintaining flexibility (vs. rigid SaaS tools like XML-Sitemaps.com).
  • Data-Driven Roadmaps: Enables A/B testing of sitemap structures (e.g., prioritizing product pages) by leveraging analytics integration (e.g., tracking lastmod impact on rankings).
  • Security & Vendor Risk Posture: v1.0.4 hardens Sitemap::store() against path traversal in the destination filename — a maintainer-responsiveness signal. Supports a "safe to depend on" decision for a package that writes files into the public web root, and gives security review a concrete artefact rather than an open question.

When to Consider This Package

  • Adopt when:

    • Your Laravel app has dynamic content (e.g., user-generated, database-driven) requiring frequent sitemap updates.
    • You need multi-format sitemaps (XML, TXT, HTML) or Google News compliance without vendor lock-in.
    • SEO is a priority, but your team lacks bandwidth for custom sitemap maintenance.
    • You’re migrating from a static sitemap (e.g., hardcoded routes) to a dynamic system.
    • Your stack includes Symfony/Laravel or a PHP monolith, and you want framework-agnostic reuse.
    • Pinned version ≥ v1.0.4: required if any part of the filename passed to Sitemap::store() is user-influenced, tenant-supplied, or configurable via admin UI. Earlier versions permit path traversal, meaning a crafted filename could write files outside the intended directory — a real risk for multi-tenant or CMS-admin surfaces.
  • Look elsewhere if:

    • Your sitemap is trivially static (e.g., <10 pages) → Use a simple .xml file.
    • You need real-time sitemap updates (e.g., per request) → Consider a headless CMS with built-in sitemap APIs (e.g., Strapi, Contentful).
    • Your team lacks PHP expertise → Evaluate JavaScript/Node.js alternatives (e.g., sitemap.xml for Next.js).
    • You require advanced analytics (e.g., sitemap performance tracking) → Pair with a dedicated SEO tool (e.g., Ahrefs API).
    • Your app is serverless → Ensure the package’s adapters (e.g., filesystem, HTTP) align with your deployment (e.g., AWS Lambda).
    • You need a documented long-term security SLA or CVE/CNA process → This package is single-maintainer with best-effort patching; a security fix landed promptly here, but there is no formal disclosure programme or LTS commitment. For regulated environments, budget for internal review on every minor bump.

How to Pitch It (Stakeholders)

For Executives: "This package lets us automate sitemap generation for our [Laravel/Symfony] app, cutting SEO maintenance costs by 80% while improving search visibility. It’s battle-tested (1.3K stars, MIT license), supports global audiences via multilingual sitemaps, and future-proofs our content strategy for Google News. The upfront cost? Zero—just a few hours of dev time to integrate. ROI? Higher organic traffic and lower manual work. One note for the risk register: v1.0.4 shipped a path-traversal fix in the file-writing API, so we adopt at v1.0.4 or later and include the package in routine dependency patching — a low, well-understood maintenance line, not a bespoke build."

For Engineering: *"php-sitemap is a lightweight, framework-agnostic solution to replace our ad-hoc sitemap logic. Key benefits:

  • Dynamic updates: Syncs with DB changes via Eloquent models or custom adapters.
  • Extensible: Supports images, videos, and Google News formats out of the box.
  • Performance: Lazy-loading and caching reduce server load.
  • Laravel-friendly: Works with routes, middleware, and queues for async generation.
  • Actively patched: v1.0.4 rejects path traversal in Sitemap::store filenames — pin ^1.0.4 minimum and treat the filename argument as untrusted input regardless. Tradeoff: Minimal learning curve (PHP-first), but we’ll need to define sitemap rules (e.g., exclude /admin). Let’s prototype it for our blog and e-commerce sections first."*

For SEO/Marketing: *"This tool will:

  1. Automate sitemap updates so we’re never penalized for stale URLs.
  2. Prioritize high-value pages (e.g., product pages, blog posts) via priority and lastmod tags.
  3. Support multilingual SEO with xhtml:link alternates for our [languages].
  4. Unlock Google News traffic if we enable the News sitemap format. Next step: Audit our current sitemap gaps and map them to the package’s features (e.g., missing video sitemaps for tutorials)."*

For Developers (Technical Deep Dive): *"Key integration points:

  • Laravel Service Provider: Register the sitemap generator as a singleton with config (e.g., config/sitemap.php).
  • Dynamic Routes: Use Sitemap::add() with Eloquent queries or route callbacks:
    Sitemap::add(Route::to('/posts/{id}')->usingModels(Post::class));
    
  • Adapters: Leverage FilesystemAdapter (for /public/sitemap.xml) or HttpAdapter (for CDN).
  • Caching: Cache sitemaps for 24h (default) or use lastmod to invalidate on content changes.
  • Testing: Mock the Sitemap class in PHPUnit with Sitemap::fake().
  • Security (v1.0.4): Sitemap::store() now rejects path traversal in the target filename. Bump to ^1.0.4, and still never interpolate user, tenant, or admin-supplied values into the filename — derive it from a fixed allowlist or hash. Audit any existing call sites that pass request data through. Gotchas: Ensure your robots.txt points to the sitemap, and validate against Google’s guidelines."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ably/pubsub-server
mstfkhazaal/defender
mfonte/base62x
karnoweb/metapilot
tobya/bcsapiwrapper
swalker2/cpanel
vish4395/laravel-translation-manager
morningtrain/economic
teksite/systeminfo-laravel
atomcms/voting
run6/weather
siokas/laravelembeddirectives
adamlien/pkuuids
gilsonsouza/lara-doc-generator
manelgavalda/enrollment_mobile
unabomber/timezone
delatbabel/contacts
astritzeqiri/g-recaptcha
kevinongko/laravel-genode
developeruz/laravel-analytics