nouvelletechno/sitemap-bundle
Symfony bundle for generating XML sitemaps from your application's routes and content. It produces search-engine-friendly sitemap files to help crawlers discover and index your pages, with a simple setup that fits into existing Symfony projects.
composer require <vendor>/<package> and publish any config with php artisan vendor:publish --tag=<package>-config if the package provides one.README and config file first: the 0.2.0 feature is route-level sitemap metadata, so the important surface area is how routes declare frequency and priority.Typical first use:
Route::get('/about', AboutController::class)
->name('about')
->sitemap(frequency: 'monthly', priority: 0.5);
Then generate the sitemap using the package’s artisan command or generator API, for example:
php artisan sitemap:generate
Verify the generated file contains the expected <url>, <changefreq>, and <priority> entries, and that the URLs are absolute rather than relative.
1.0, detail pages at 0.8, and archive pages at 0.4.public/sitemap.xml or object storage.php artisan route:cache. Clear and rebuild route caches as part of deployment.robots.txt at the generated sitemap URL, and ensure the sitemap URL itself is not blocked by middleware or auth.Example with dynamic priorities:
Route::get('/posts/{post}', [PostController::class, 'show'])
->name('posts.show')
->sitemap(
frequency: 'weekly',
priority: fn ($post) => $post->isFeatured() ? 0.9 : 0.6
);
route:cache. Always test sitemap generation against a production-like cached route table.APP_URL, proxy headers, and trusted proxies so generated links use the correct scheme and host.changefreq values are constrained (always, hourly, daily, weekly, monthly, yearly, never). Validate or constrain values to avoid invalid XML.priority should be between 0.0 and 1.0. Avoid treating it as a ranking guarantee; search engines treat it as a hint at best.public/sitemap.xml, ensure deploy scripts and web servers do not serve a stale file. Regenerate during deployment or via a scheduled job.php artisan route:list to confirm which routes carry sitemap metadata.How can I help you explore Laravel packages today?