Weave Code
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

Laravel Sitemap Laravel Package

spatie/laravel-sitemap

Generate XML sitemaps for Laravel automatically by crawling your site or building them manually. Add URLs, models, lastmod/changefreq/priority, images and alternates, then write to file or disk. Supports sitemap index and large sites.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • SEO & Discoverability: Accelerate organic search rankings by automating sitemap generation for dynamic Laravel applications, ensuring search engines index critical pages (e.g., blog posts, product listings) without manual updates.
  • Scalability: Replace manual sitemap maintenance (e.g., XML files edited post-deployment) with a crawl-based approach that adapts to new routes, reducing technical debt as the product evolves.
  • Multilingual/Regional Support: Enable alternate language tags (e.g., /en, /es) for global audiences, aligning with Google’s hreflang guidelines.
  • News/Time-Sensitive Content: Add Google News sitemap tags for publishers or platforms with breaking news, improving visibility in Google News.
  • Build vs. Buy: Buy (avoid custom development) for:
    • Startups/agencies needing fast SEO compliance without hiring a dev.
    • Enterprises with dynamic content (e.g., CMS-driven sites) where manual sitemaps are unsustainable.
    • Teams prioritizing developer velocity over bespoke solutions.
  • Roadmap Priorities:
    • Phase 1: Automate sitemap generation for existing routes (crawl-based).
    • Phase 2: Integrate with Laravel Nova/Panel for non-technical editors to manually add URLs (e.g., promotional pages).
    • Phase 3: Extend to video/image sitemaps (via spatie/laravel-sitemap extensions or custom tags).

When to Consider This Package

Adopt If:

  • Your Laravel app has dynamic routes (e.g., /posts/{slug}) that change frequently, making manual sitemaps impractical.
  • You need SEO compliance for Google News, multilingual sites, or rich media (images/videos) without building from scratch.
  • Your team lacks bandwidth to maintain static XML sitemaps post-deployment.
  • You’re using Laravel’s built-in routing and want to leverage existing URL structures without rewriting logic.
  • Crawl performance is acceptable for your site size (configurable concurrency/depth; default: 10 concurrent requests, depth unlimited).

Look Elsewhere If:

  • Your sitemap is static and tiny (e.g., <10 URLs). A manual XML file may suffice.
  • You need real-time sitemap updates (e.g., per-user personalized content). Consider event-driven sitemaps (e.g., Laravel Echo + Pusher) or a headless CMS with native sitemap support.
  • Your app uses JavaScript-heavy SPAs (e.g., React/Vue) with client-side routing. Use a client-side sitemap generator (e.g., Next.js sitemap) or pre-rendering.
  • You require advanced analytics (e.g., tracking sitemap crawl errors). Pair with Google Search Console API or Sentry monitoring.
  • Your stack isn’t PHP/Laravel. Use framework-specific tools (e.g., Django’s django-sitemap, Ruby on Rails’ sitemap_generator).

How to Pitch It (Stakeholders)

For Executives/Non-Technical Stakeholders:

"This package automates our sitemap generation—critical for SEO and search visibility—so we don’t have to manually update XML files every time we add new content. Think of it like a ‘set it and forget it’ tool for Google’s crawlers. For example:

  • Blogs/Publishers: Ensures every article is indexed by Google News automatically.
  • E-commerce: Dynamically updates product pages as inventory changes.
  • Multilingual Sites: Adds language tags (e.g., /en, /es) with zero extra work. It’s a low-cost, high-impact fix for a common technical debt problem. The team can deploy it in hours, not weeks."

For Engineers/Technical Leads:

"spatie/laravel-sitemap solves the ‘sitemap maintenance tax’ for Laravel apps by:

  • Crawling your site (configurable depth/concurrency) to auto-discover routes, reducing manual work.
  • Supporting advanced tags (hreflang, news, images) out of the box—no need to build custom XML logic.
  • Integrating seamlessly with Laravel’s ecosystem (e.g., Sitemapable interface for Eloquent models, scheduled commands).
  • Avoiding vendor lock-in: MIT-licensed, well-documented, and extensible (e.g., filter URLs, customize crawler behavior).

Tradeoffs:

  • Crawling large sites may require tuning (e.g., setMaximumCrawlCount, setConcurrency).
  • JavaScript-heavy sites need spatie/browsershot for dynamic content (adds ~50MB dependency).

Alternatives considered:

  • Custom solution: 2–3 dev days to build; higher maintenance.
  • Third-party SaaS: Monthly costs; less control over sitemap structure.

Recommendation: Pilot on a non-critical section (e.g., blog) to validate crawl accuracy before full rollout."


Key Metric to Track Post-Implementation:

  • Google Search Console: Increase in indexed pages (target: +30% in 30 days).
  • Developer Productivity: Time saved on sitemap updates (e.g., from 2 hours/month to 0).
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport