# Kirby Sitemap Query

**URL:** <https://forum.getkirby.com/t/kirby-sitemap-query/5913>\
**Category:** Plugins\
**Created:** [December 1, 2016, 10:04am UTC](https://forum.getkirby.com/t/kirby-sitemap-query/5913 "2016-12-01T10:04:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [December 1, 2016, 10:04am UTC](https://forum.getkirby.com/t/kirby-sitemap-query/5913/1 "2016-12-01T10:04:47Z")

</div>

There are already many Kirby sitemap plugins out there: [https://github.com/jenstornell/kirby-plugins/issues?utf8=✓&q=is%3Aissue%20is%3Aopen%20sitemap](https://github.com/jenstornell/kirby-plugins/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20sitemap)

I always felt limited by them. On my sites I have a “quick and dirty” solution, but this time I wanted to create a long lasting, more elegant solution.

## Kirby Sitemap Query - is born

**Github:** [https://github.com/jenstornell/kirby-sitemap-query](https://github.com/jenstornell/kirby-sitemap-query)

_A sitemap xml plugin without boundaries._

**Add this** `sitemap-query.php` snippet:

```php
sitemapQuery::add('https://example.com/contact');
sitemapQuery::add(array(
  'loc' => 'https://example.com/about',
  'lastmod' => '2004-11-23',
  'priority' => '0.3',
  'changefreq' => 'weekly'
));

```

It will land on `http://example.com/sitemap.xml`.

**If no snippet is added it will fallback to all pages:**

```php
<?php
foreach( site()->index() as $page ) {	
  $url['priority'] = ( $page->isHomePage() ) ? 1 : '0.5';

  sitemapQuery::add(array(
    'loc' => $page->url(),
    'lastmod' => $page->modified('Y-m-d'),
    'priority' => $url['priority'],
  ));
}

```

There are some options and more information which you can read about here: [https://github.com/jenstornell/kirby-sitemap-query](https://github.com/jenstornell/kirby-sitemap-query)
