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

roumen/sitemap

Roumen/sitemap is a Laravel package for generating XML sitemaps with support for tags, caching, and multiple sitemap files. It integrates easily with Laravel apps to help search engines discover and index your content.

View on GitHub
Deep Wiki
Context7

roumen/sitemap is a lightweight Laravel package for generating and managing XML sitemaps. It offers a fluent API to build sitemaps from database queries, routes, or custom URLs, with support for sitemap indexes, caching, and automatic routing.

  • Fluent API for adding URLs, tags, and metadata
  • Supports multiple sitemaps and sitemap index files
  • Image, video, and news sitemap extensions
  • Built-in caching and seamless Laravel integration
  • Configurable routing and easy customization
Frequently asked questions about Sitemap
How do I install roumen/sitemap in a Laravel application?
Install it with Composer using composer require roumen/sitemap, then publish the package configuration if you need to change defaults such as caching, sitemap paths or output format. In Laravel you typically register a route that returns the generated sitemap, or generate it from a scheduled command. The core generator is framework-agnostic PHP, so the same code can also run in a plain PHP script or a CLI worker outside Laravel.
Does roumen/sitemap support sitemap indexes for sites with more than 50,000 URLs?
Yes, the package supports splitting a large site into multiple sitemaps and emitting a sitemap index that references them, which is the pattern you need once you approach the sitemaps.org limits of 50,000 URLs or 50 MB uncompressed per file. You should still confirm gzip output and index generation against your installed version, because these are exactly the features that get assumed rather than tested. Plan your partitioning strategy (by locale, domain, or content type) before you hit the limits rather than after.
Which PHP and Laravel versions does roumen/sitemap support?
Check the declared constraints in the package's composer.json rather than the README, since utilities of this vintage often lag the newest Laravel major by a release cycle. Run composer why-not roumen/sitemap in your project to see exactly which constraint blocks an upgrade. Also confirm the package's CI matrix actually covers your current PHP and Laravel LTS versions before you commit.
How do I add URLs with lastmod, changefreq and priority in roumen/sitemap?
The package exposes a fluent API where you add a URL and then attach metadata such as lastmod, changefreq and priority before the sitemap is rendered. You can build the URL list from your route table, CMS content, product catalog, or a read replica behind a single application-owned source interface. Keeping that source behind your own interface means the package stays a replaceable leaf dependency instead of something your domain code is coupled to.
Can roumen/sitemap generate TXT, HTML and Google News sitemaps, not just XML?
Yes, the underlying library is framework-agnostic and generates XML, TXT, HTML and Google News format sitemaps from the same URL set. The HTML output is useful as a human-facing sitemap page, and the Google News format matters if you publish articles that need to surface quickly in news results. Keep in mind that each format has different validation rules, so test each one you actually serve.
How do I cache a sitemap so it is not regenerated on every request?
The package supports caching, and the more robust pattern is to generate the sitemap in a scheduled job or queue worker and write the result to storage rather than building it during a request. Serve the pre-built file through your web server or a CDN, and invalidate or rewrite it whenever content changes. This keeps response times flat regardless of how many URLs your site has.
Should sitemap generation run in the request path in production?
No. Sitemap generation is an offline, batch, read-only concern, so it belongs in a scheduled command or CLI worker that writes output to disk or object storage. Serving a cached static file avoids the memory and CPU spikes you get from assembling thousands of URLs per request, and it makes CDN caching and cache-busting straightforward. It also keeps rollback trivial: you delete a file and re-point a route.
Does roumen/sitemap correctly escape ampersands and UTF-8 characters in URLs?
The package handles XML escaping for URL content, but you should verify it against your own edge cases, especially query strings containing ampersands and slugs with accented or non-Latin characters. If output goes through a templating layer, confirm the escaping behavior there rather than assuming it. A golden-file test with a handful of deliberately awkward URLs is the fastest way to catch encoding regressions.
How do I test a sitemap generator and check memory use at 10,000+ URLs?
Sitemap output is deterministic, which makes it ideal for golden-file tests: generate once, commit the expected output, and diff on every change. Validate the result against the sitemaps.org schema and assert URL counts, index references and escaping behavior. For scale, generate a fixture with 10,000 or more URLs and watch memory, since in-memory DOM assembly is the usual failure point at that size.
Is roumen/sitemap actively maintained, and what are the alternatives?
It is a small MIT-licensed package with a single maintainer and low downstream usage counts, so treat it as a bus-factor-of-one dependency and confirm that the GitHub repository you are reviewing is the canonical source for the roumen/sitemap Packagist entry before pinning it. The MIT license means an internal fork is always available, which caps the continuity risk. If your estate is entirely Laravel, also evaluate Laravel-native alternatives such as spatie/laravel-sitemap that bundle crawling and sharding, and pick whichever sits behind your own URL-source interface.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect