Almost all websites have sitemap functionality and it does almost always exactly the same: display a tree with pages from your website for your regular visitors and generate xml files for Google. Because the functionality is always the same we implemented the KunstmaanSitemapBundle to use it in our new projects. It saves us some valuable time and is very easy to set up.

Installation instructions are simple, just add "kunstmaan/sitemap-bundle" to your composer.json

"require": {
        "kunstmaan/sitemap-bundle": "*"
public function registerBundles()
        $bundles = array(
            // ...
            new Kunstmaan\SitemapBundle\KunstmaanSitemapBundle(),
            // ...
# KunstmaanSitemapBundle
    resource: "@KunstmaanSitemapBundle/Resources/config/routing.yml"
    prefix:   /{_locale}/
        _locale: %requiredlocales%

After the installation you can access /en/sitemap.xml from your browser and you'll see a nice xml sitemap, ready to be indexed by Google.

Sitemap XML

For your regular visitors you can simply add the SitemapPage as a child page to one of your pages and change the layout if you want. We also added a couple of twig helper functions. Just have a look at the documentation if you want to get started.

Sitemap frontend

If you like what you see, please recommend this bundle on KnpBundles!