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 by crawling your site or building them manually. Add extra URLs, set last-modified dates, and include models via a simple interface. Write sitemaps to disk with a fluent, developer-friendly API.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • SEO & Discoverability: Automatically generate and maintain sitemaps to improve search engine indexing, reducing manual effort and ensuring critical pages (e.g., blog posts, product listings) are prioritized.
  • Dynamic Content Inclusion: Leverage the Sitemapable interface to auto-generate sitemap entries for Eloquent models (e.g., Post, Product), eliminating hardcoded URLs and keeping sitemaps synchronized with database changes.
  • Multilingual & Localization Support: Add alternate language URLs (e.g., /post/post/en, /post/es) to support global audiences without manual updates.
  • Crawl Budget Optimization: Configure crawl depth, concurrency, and exclusions (e.g., /admin, /login) to focus on high-value pages and avoid overloading search engines.
  • Scheduled Updates: Integrate with Laravel’s task scheduling to regenerate sitemaps post-content updates (e.g., daily for blogs, hourly for e-commerce).
  • JavaScript-Rendered Content: Enable headless Chrome crawling to include dynamically loaded content (e.g., SPAs, AJAX-loaded pages) in sitemaps.
  • Sitemap Indexing: Group large sitemaps into indexed files (e.g., sitemap-index.xml with posts_sitemap.xml, pages_sitemap.xml) for scalability.
  • Build vs. Buy: Avoid reinventing sitemap generation logic; adopt a battle-tested, maintained package with 2.6K+ stars and active development.
  • Compliance & Extensibility: Support Google News sitemaps, custom metadata (e.g., lastmod, priority), and third-party integrations (e.g., analytics, CDNs).

When to Consider This Package

  • Static or Small Sites: If your site has <50 pages or static content, manually maintaining a sitemap.xml file may suffice.
  • Highly Dynamic SPAs: If your site relies on client-side routing (e.g., React/Vue) and lacks server-rendered URLs, consider a custom solution or a package like next-sitemap (for Next.js).
  • Legacy Systems: If your stack doesn’t support PHP/Laravel, evaluate alternatives like Python’s django-sitemap or Node.js’s sitemap.xml.
  • Custom Crawling Logic: If you need advanced crawling (e.g., API-driven discovery, non-HTTP sources), extend the underlying spatie/crawler or build a bespoke solution.
  • Performance Constraints: For sites with >10K pages, test crawl concurrency limits and consider incremental generation (e.g., only update modified pages).
  • Non-Laravel PHP: If using vanilla PHP (not Laravel), use the standalone spatie/sitemap package instead.

How to Pitch It (Stakeholders)

For Executives: "This package automates sitemap generation—critical for SEO and search visibility—while reducing dev ops overhead. It crawls our site intelligently, includes dynamic content (e.g., blog posts, products), and supports multilingual audiences. With scheduled updates, we ensure search engines always index the latest content, driving organic traffic without manual maintenance. The MIT license and Spatie’s track record (2.6K stars) make it a low-risk, high-impact investment."

For Engineers: *"Leverage spatie/laravel-sitemap to:

  • Auto-generate sitemaps via crawling or model integration (Sitemapable).
  • Customize crawls: Filter URLs, limit depth/concurrency, or ignore robots.txt.
  • Support JS-heavy sites with headless Chrome rendering (requires spatie/browsershot).
  • Schedule updates via Laravel’s task scheduler (e.g., daily for blogs).
  • Scale with sitemap indexes for large sites.
  • Extend easily: Add news tags, alternates, or custom metadata. No reinventing the wheel—just configure and deploy."*

For SEO/Marketing Teams: *"This tool ensures our sitemap is always up-to-date, helping search engines discover and rank our content faster. Key benefits:

  • Automated updates post-publishing (no manual edits).
  • Multilingual support for global audiences.
  • Priority pages (e.g., products, blogs) are always indexed.
  • Compliance with Google News and standard sitemap formats. Less guesswork, more visibility."*

For DevOps: *"Minimal infrastructure impact:

  • Lightweight PHP package (no heavy dependencies by default).
  • Configurable crawl settings to avoid server load.
  • Supports cloud storage (S3, etc.) via Laravel’s filesystem.
  • Scheduled via Laravel’s built-in task runner (no cron setup needed)."*
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai